energy counters misbehaving/reset/unavailable after 2023.5.0

System Health details
System Information

version
core-2023.5.2

installation_type
Home Assistant Supervised

dev
false

hassio
true

docker
true

user
root

virtualenv
false

python_version
3.10.11

os_name
Linux

os_version
5.10.0-19-amd64

arch
x86_64

timezone
Europe/Stockholm

config_dir
/config

Home Assistant Community Store

GitHub API
ok

GitHub Content
ok

GitHub Web
ok

GitHub API Calls Remaining
4632

Installed Version
1.32.1

Stage
running

Available Repositories
1284

Downloaded Repositories
50

Home Assistant Cloud

logged_in
false

can_reach_cert_server
ok

can_reach_cloud_auth
ok

can_reach_cloud
ok

Home Assistant Supervisor

host_os
Debian GNU/Linux 11 (bullseye)

update_channel
stable

supervisor_version
supervisor-2023.04.1

agent_version
1.2.1

docker_version
20.10.21

disk_total
78.2 GB

disk_used
55.7 GB

healthy
true

supported
true

supervisor_api
ok

version_api
ok

installed_addons
Studio Code Server (5.5.7), MariaDB (2.6.0), InfluxDB (4.6.0), Mosquitto broker (6.2.1), phpMyAdmin (0.8.5), ESPHome (2023.4.4), Frigate NVR Proxy (1.3), Node-RED (14.1.5), Zigbee2MQTT (1.30.4-1), Network UPS Tools (0.11.2)

Dashboards

dashboards
2

resources
30

views
20

mode
storage

Recorder

oldest_recorder_run
May 4, 2023 at 04:29

current_recorder_run
May 8, 2023 at 08:47

estimated_db_size
1681.28 MiB

database_engine
mysql

database_version
10.6.12

Spotify

api_endpoint_reachable
ok

Checklist

[X] I have read the FAQ to see if there is a known solution to my problem.
[X] I have enabled debug logging for my installation.
[X] I have filled out the issue template to the best of my ability.
[X] This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
[X] This issue is not a duplicate issue of currently previous issues..

Describe the issue
Noticed today that all energy counters got reset, seems all groups are marked as unavailable until at least one lamp is turned on/off after reboot of HA
I have nestled groups, like "indoor lights -> roomX", like this:
https://github.com/gribber/ha/blob/main/sensors/powercalc.yaml
every room which had at least one unavailable lamp is marked as unavailable (for example, I have some christmas lamps disconnected)
Turing on any other lamp in that room makes the group energy counter available again, but with incorrect values
living room group

main indoor light group

as seen, this groups hasn't changed since 06:24:55, which is exactly the time I updated to HA 2023.5.0
Reproduction steps
something like:

update to 2023.5.0
disconnect a lamp
reboot

Debug logs
https://pastebin.com/PwTtu6Ls

Diagnostics dump or YAML config

platform: powercalc
create_group: "outdoor lights"
unique_id: 28782826-4b21-44d0-8105-60e6b9338bd2
entities:

create_group: "outdoor parking driveway"
unique_id: 9366ba2a-8a65-4465-86cf-8651d0765ac2
include:
area: parkering_och_uppfart
filter:
domain: light
create_group: "outdoor ambience"
unique_id: 4dbfacbd-7fc4-40a6-a4e6-26e385db0f12
include:
area: dekoration_ute
filter:
domain: light

platform: powercalc
create_group: "indoor lights"
unique_id: 0259ae80-3fd3-40fe-9cf9-1857f2e28fc0
entities:

create_group: "conservatory"
unique_id: 5d77adcf-200f-4111-b1a7-eee8ea1e2a0e
include:
area: uterum
filter:
domain: light
create_group: "kitchen"
unique_id: 24069df6-d3f6-443a-9cc2-ea50b2f1d064
include:
area: kitchen
filter:
domain: light
create_group: "family room"
unique_id: 49d8f20c-79f0-4a4a-a83f-618ef66c7a83
include:
area: allrum
filter:
domain: light
create_group: "bathroom"
unique_id: 8555a54f-b7e2-47b0-b85d-d89ce3d8287f
include:
area: badrum_nere
filter:
domain: light
entities:

entity_id: light.bathroom_downstairs_mirror
standby_power: 1.2
fixed:
power: 12.3

create_group: "toilet_upstairs"
unique_id: 0267cf53-3359-4686-bfc1-8ffb1f5fa60b
include:
area: toalett_uppe
filter:
domain: light
entities:

entity_id: light.upper_toilet
fixed:
power: "{{ states('sensor.upper_toilet_power') }}"

create_group: "hallway downstairs"
unique_id: 12012df5-0c82-44c0-9b7b-3b7a4047f315
include:
area: hallen
filter:
domain: light
create_group: "living room"
unique_id: 0d8e5469-4703-443e-9110-78f7c27f8319
include:
area: living_room
filter:
domain: light
create_group: "hallway upstairs"
unique_id: f4e03db2-285a-4c76-98ad-f4b04b7c4e02
include:
area: hall_uppe
filter:
domain: light
create_group: "office"
unique_id: ffbefefc-deec-4da8-a06e-841890dc8d43
include:
area: hobbyrummet
filter:
domain: light
entities:

entity_id: light.office_led_strip
standby_power: 0.1
fixed:
power: 18.4

create_group: "bedroom"
unique_id: 88566455-3dcf-4aa3-968c-e9545e92b64e
include:
area: bedroom
filter:
domain: light
create_group: "laundry room"
unique_id: 6876c60a-971b-4d89-a3f8-0a8c7110c0ea
include:
area: tvattstuga
filter:
domain: light
entities:

entity_id: switch.laundry_room_channel_1
fixed:
power: "{{ states('sensor.laundry_room_channel_1_power') }}"

platform: powercalc
create_group: "garage lights"
unique_id: 765c1684-143e-43da-80b6-8f0ca239db38
entities:

create_group: "garage"
unique_id: 91a4db55-77bf-49d1-bc51-da2b42c1abbe
include:
area: garage
filter:
domain: light
create_group: "techroom"
unique_id: e226b01a-fd61-4828-bea8-f9a4cb1da3d7
include:
area: teknikrum
filter:
domain: light
create_group: "boiler_room"
unique_id: 8d0333ee-7245-480d-97d8-5b5450c80049
include:
area: pannrum
filter:
domain: light
create_group: "washhouse"
unique_id: b5bdb743-c3ab-400e-afc3-d5822341050e
include:
area: grovtvattstuga
filter:
domain: light

platform: powercalc
unique_id: 3788b38d-5330-4c7e-a0ea-8565dda2c6c9
entity_id: sensor.dummy
name: "techups"
fixed:
power: "{{states('sensor.techups_power_tmp')}}"

platform: powercalc
create_group: "smart speakers"
unique_id: f883310e-e09c-4d1c-8ef7-b2e83b530324
entities:

entity_id: media_player.hobbyroom_speaker
entity_id: media_player.kitchen_display
entity_id: media_player.vardagsrummet_speaker
entity_id: media_player.sovrummet_speaker

platform: powercalc
create_group: "environment and air quality"
unique_id: f5f210d6-1608-467e-b272-a7b0a83ae6b2
entities:

entity_id: fan.livingroom_starkvind
fixed:
power: >
{% set map = {
'0' : 0,
'1' : 2.0,
'2' : 2.8,
'3' : 4.8,
'4' : 7.6,
'5' : 11.9,
'6' : 17.8,
'7' : 26.3,
'8' : 30.6,
'9' : 35.8
} %}
{{ map[states('sensor.livingroom_starkvind_fan_speed')] if is_number(states('sensor.livingroom_starkvind_fan_speed')) else 0 }}

Could you please try latest beta 1.6.0 of powercalc?
A lot of things has been changed to improve the group energy sensors. Hope this also solves your issue.
Please create a backup of your HA first just in case.

Btw these errors in your log are definitely related:
ValueError: Sensor sensor.kitchen_power has device class power, state class measurement unit W and suggested precision None thus indicating it has a numeric value; however, it has the non-numeric value: unavailable (<class 'str'>)
2023-05-08 08:40:49.740 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up powercalc platform for sensor

There are a lot of integrations which are broken or misbehaving due to this change.
v1.6.0 of powercalc should also handle this case, but there are a lot of things changed in this version.
I did not get any response from any user which has tested this version of powercalc and would really need some confirmations before releasing this to the public.

Could you please try latest beta 1.6.0 of powercalc? A lot of things has been changed to improve the group energy sensors. Hope this also solves your issue. Please create a backup of your HA first just in case.

Sure, I can try it out, what is the best way to switch to beta version?

In hacs you can click redownload and mark the check box with beta versions.

I tried the latest beta.9. I still doesnt see any energy value for the light group defined in config.yaml by "create_domain_group" , only unavailable. The power entity (W) works but not the energy (kWh) .

Updated to beta.9
Same result here, energy still unavailable
log:

Found 4 non-daemonic threads.
[10:40:23] INFO: Home Assistant Core finish process exit code 0
[10:40:23] INFO: Home Assistant Core service shutdown
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
2023-05-08 12:40:29.120 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration powercalc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.121 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration energyscore which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.122 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration swemail which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.123 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration xiaomi_cloud_map_extractor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.123 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration frigate which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.124 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration auto_backup which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.125 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration blitzortung which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.125 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration dreame_vacuum which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.126 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sureha which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.127 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration kia_uvo which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.127 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration browser_mod which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.128 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nodered which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.128 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nordpool which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.129 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration husqvarna_automower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.130 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration mold_risk_index which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.130 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration ferroamp which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.131 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration pax_ble which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.131 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration home_connect_alt which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-08 12:40:29.132 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant.  Power:0.00
2023-05-08 12:40:43.833 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.laundry_room_channel_1: State changed to "off". Power:0.00
2023-05-08 12:40:43.920 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.upper_toilet: State changed to "off". Power:0.00
2023-05-08 12:40:43.922 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.upper_toilet: State changed to "off". Power:0.00
2023-05-08 12:40:44.177 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up sureha platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/sureha/sensor.py", line 59, in async_setup_entry
    entities.append(Flap(spc.coordinator, surepy_entity.id, spc))
  File "/config/custom_components/sureha/sensor.py", line 179, in __init__
    self._attr_entity_picture = self._surepy_entity.icon
  File "/usr/local/lib/python3.10/site-packages/surepy/entities/devices.py", line 210, in icon
    if self.state == LockState.LOCKED_ALL:
  File "/usr/local/lib/python3.10/site-packages/surepy/entities/devices.py", line 198, in state
    return LockState(self._data["status"]["locking"]["mode"])
  File "/usr/local/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: None is not a valid LockState
2023-05-08 12:40:47.329 DEBUG (MainThread) [custom_components.powercalc.sensors.power] fan.livingroom_starkvind: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.418 DEBUG (MainThread) [custom_components.powercalc.sensors.power] fan.livingroom_starkvind: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.419 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bathroom_downstairs_mirror: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.419 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.office_led_strip: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.419 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_left: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.419 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_right: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.419 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.mushroom_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.419 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_ceiling: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_bench: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.driveway_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.420 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.421 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.421 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.421 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_front: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.421 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.greenhouse_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.421 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_7: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.421 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_5: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.421 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_6: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.422 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_side: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.422 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.422 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.earth_cellar: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.422 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_ceiling: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.422 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.422 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.423 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.423 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.rice_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.423 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.kitchen_table: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.424 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.424 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.kitchen_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.424 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.family_room_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.424 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.laundry_room_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.424 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.424 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.424 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_upstairs_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.425 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.426 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.kitchen_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.426 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_entrance: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.426 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:47.426 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.584 DEBUG (MainThread) [custom_components.powercalc.sensors.power] fan.livingroom_starkvind: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.600 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bathroom_downstairs_mirror: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.600 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.office_led_strip: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.600 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_left: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.600 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_right: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.600 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.mushroom_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.601 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_ceiling: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.601 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_bench: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.601 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.driveway_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_front: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.602 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.greenhouse_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_7: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_5: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_6: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_side: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.earth_cellar: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_ceiling: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.603 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.rice_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.family_room_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.604 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.605 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.605 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.605 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_upstairs_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.605 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.605 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_entrance: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.605 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:48.606 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:50.115 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.vardagsrummet_speaker: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:50.137 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.vardagsrummet_speaker: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:50.138 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.hobbyroom_speaker: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:50.143 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.hobbyroom_speaker: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:50.430 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.vardagsrummet_speaker: State changed to "off". Power:1.65
2023-05-08 12:40:50.493 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.vardagsrummet_speaker: State changed to "off". Power:1.65
2023-05-08 12:40:51.367 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.hobbyroom_speaker: State changed to "off". Power:1.65
2023-05-08 12:40:51.411 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.hobbyroom_speaker: State changed to "off". Power:1.65
2023-05-08 12:40:51.710 WARNING (MainThread) [homeassistant.config_entries] Config entry 'shellyplus1-441793a5123c' for shelly integration not ready yet: DeviceConnectionError(DeviceConnectionError(TimeoutError())); Retrying in background
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_front: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_side: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.driveway_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.earth_cellar: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.009 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_6: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_7: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_5: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.greenhouse_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.010 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_ceiling: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.rice_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.kitchen_table: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.kitchen_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.kitchen_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.family_room_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bathroom_downstairs_mirror: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.upper_toilet: State changed to "off". Power:0.00
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_bench: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.011 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_entrance: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.mushroom_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_window_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_4: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.012 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_3: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_2: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_upstairs_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.office_led_strip: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_left: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_right: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_ceiling: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.013 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.laundry_room_window: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.014 DEBUG (MainThread) [custom_components.powercalc.sensors.power] switch.laundry_room_channel_1: State changed to "off". Power:0.00
2023-05-08 12:40:56.026 DEBUG (MainThread) [custom_components.powercalc.sensors.power] sensor.dummy: State changed to "on". Power:27.00
2023-05-08 12:40:56.027 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.hobbyroom_speaker: State changed to "off". Power:1.65
2023-05-08 12:40:56.028 DEBUG (MainThread) [custom_components.powercalc.sensors.power] media_player.vardagsrummet_speaker: State changed to "off". Power:1.65
2023-05-08 12:40:56.028 DEBUG (MainThread) [custom_components.powercalc.sensors.power] fan.livingroom_starkvind: Source entity has an invalid state, setting power sensor to unavailable
2023-05-08 12:40:56.068 DEBUG (MainThread) [custom_components.powercalc.sensors.power] sensor.dummy: State changed to "on". Power:27.00
2023-05-08 12:40:56.175 DEBUG (MainThread) [custom_components.powercalc.sensors.energy] Creating energy sensor: All standby energy
2023-05-08 12:40:56.309 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities light.shelly_shower or it is/they are currently not available
2023-05-08 12:40:56.347 WARNING (MainThread) [homeassistant.components.automation.kitchen_lights] Kitchen: lights: Already running
2023-05-08 12:40:56.370 WARNING (MainThread) [custom_components.hacs] You have 'AitorDB/home-assistant-sun-card' installed with HACS this repository has been removed from HACS, please consider removing it. Removal reason (Repository is archived)
2023-05-08 12:40:56.645 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.mushroom_lamp: State changed to "off". Power:0.40
2023-05-08 12:40:56.882 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.family_room_window_1: State changed to "off". Power:0.20
2023-05-08 12:40:56.887 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_bench: State changed to "off". Power:0.48
2023-05-08 12:40:56.938 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_left: State changed to "off". Power:0.17
2023-05-08 12:40:57.056 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_right: State changed to "off". Power:0.17
2023-05-08 12:40:57.075 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_ceiling: State changed to "off". Power:0.36
2023-05-08 12:40:57.153 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bedroom_window: State changed to "off". Power:0.27
2023-05-08 12:40:57.551 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_window_1: State changed to "off". Power:0.20
2023-05-08 12:40:57.552 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:40:57.552 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.rice_lamp: State changed to "off". Power:0.25
2023-05-08 12:40:57.576 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_upstairs_window: State changed to "off". Power:0.10
2023-05-08 12:40:57.581 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_1: State changed to "off". Power:0.17
2023-05-08 12:40:57.581 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.entre_2: State changed to "off". Power:0.17
2023-05-08 12:40:57.764 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bathroom_downstairs_mirror: State changed to "off". Power:1.20
2023-05-08 12:40:57.777 DEBUG (MainThread) [custom_components.powercalc.sensors.power] fan.livingroom_starkvind: State changed to "on". Power:2.00
2023-05-08 12:40:57.778 DEBUG (MainThread) [custom_components.powercalc.sensors.power] fan.livingroom_starkvind: State changed to "on". Power:2.00
2023-05-08 12:40:57.784 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.environment_and_air_quality_energy: Recalculate, current value: 4.3287
2023-05-08 12:40:57.785 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.livingroom_starkvind_energy: 0E-50
2023-05-08 12:40:57.785 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.environment_and_air_quality_energy: New value: 4.328700000000000000000000000
2023-05-08 12:40:57.838 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.driveway_1: State changed to "off". Power:0.17
2023-05-08 12:40:57.845 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_front: State changed to "off". Power:0.17
2023-05-08 12:40:57.846 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.garage_side: State changed to "off". Power:0.17
2023-05-08 12:40:57.846 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_1: State changed to "off". Power:0.17
2023-05-08 12:40:57.846 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_2: State changed to "off". Power:0.17
2023-05-08 12:40:57.847 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.parking_3: State changed to "off". Power:0.17
2023-05-08 12:40:57.847 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_1: State changed to "off". Power:0.27
2023-05-08 12:40:57.847 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_2: State changed to "off". Power:0.27
2023-05-08 12:40:57.847 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_3: State changed to "off". Power:0.27
2023-05-08 12:40:57.848 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_4: State changed to "off". Power:0.27
2023-05-08 12:40:57.848 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_5: State changed to "off". Power:0.27
2023-05-08 12:40:57.848 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_6: State changed to "off". Power:0.27
2023-05-08 12:40:57.848 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.wall_7: State changed to "off". Power:0.27
2023-05-08 12:40:57.849 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.greenhouse_1: State changed to "off". Power:0.27
2023-05-08 12:40:57.867 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.earth_cellar: State changed to "off". Power:0.17
2023-05-08 12:40:57.867 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_2: State changed to "off". Power:0.20
2023-05-08 12:40:57.868 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_3: State changed to "off". Power:0.20
2023-05-08 12:40:57.868 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_1: State changed to "off". Power:0.20
2023-05-08 12:41:15.923 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:41:15.923 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:41:15.923 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:41:15.927 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.living_room_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.livingroom_front_3_energy,sensor.livingroom_front_1_energy,sensor.livingroom_back_4_energy,sensor.mushroom_lamp_energy,sensor.livingroom_back_3_energy,sensor.livingroom_back_1_energy,sensor.livingroom_window_1_energy,sensor.livingroom_front_2_energy,sensor.livingroom_back_2_energy,sensor.livingroom_front_4_energy)
2023-05-08 12:41:15.928 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.indoor_lights_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.hallway_downstairs_1_energy,sensor.laundry_room_window_energy,sensor.livingroom_back_3_energy,sensor.livingroom_front_2_energy,sensor.livingroom_back_2_energy,sensor.bedroom_ceiling_energy,sensor.bathroom_downstairs_mirror_energy,sensor.livingroom_front_3_energy,sensor.family_room_window_1_energy,sensor.mushroom_lamp_energy,sensor.livingroom_window_1_energy,sensor.livingroom_front_4_energy,sensor.bedroom_window_energy,sensor.office_led_strip_energy,sensor.kitchen_table_energy,sensor.conservatory_ceiling_energy,sensor.hallway_upstairs_window_energy,sensor.hallway_downstairs_bench_energy,sensor.hallway_downstairs_2_energy,sensor.rice_lamp_energy,sensor.hallway_downstairs_entrance_energy,sensor.bedroom_right_energy,sensor.livingroom_front_1_energy,sensor.livingroom_back_4_energy,sensor.kitchen_window_1_energy,sensor.livingroom_back_1_energy,sensor.bedroom_left_energy,sensor.kitchen_lamp_energy)
2023-05-08 12:41:17.918 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:41:29.816 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.office_led_strip: State changed to "off". Power:0.10
2023-05-08 12:41:29.906 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.conservatory_ceiling: State changed to "off". Power:0.17
2023-05-08 12:41:29.968 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_4: State changed to "off". Power:0.30
2023-05-08 12:41:29.969 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_4: State changed to "off". Power:0.30
2023-05-08 12:41:29.969 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_1: State changed to "off". Power:0.30
2023-05-08 12:41:29.969 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_3: State changed to "off". Power:0.30
2023-05-08 12:41:29.970 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_2: State changed to "off". Power:0.30
2023-05-08 12:41:29.970 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_3: State changed to "off". Power:0.30
2023-05-08 12:41:29.971 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: State changed to "off". Power:0.30
2023-05-08 12:41:29.971 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_2: State changed to "off". Power:0.30
2023-05-08 12:41:29.998 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_entrance: State changed to "off". Power:0.17
2023-05-08 12:41:29.998 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_1: State changed to "off". Power:0.20
2023-05-08 12:41:30.019 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.hallway_downstairs_2: State changed to "off". Power:0.20
2023-05-08 12:42:01.086 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:42:01.087 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:42:01.087 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:42:03.081 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:42:34.234 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:42:34.234 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:42:34.234 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:42:36.215 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:42:48.320 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:42:48.321 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:42:48.321 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:42:50.302 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:43:34.418 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_front_1: Looking up power usage for bri:1 mired:331
2023-05-08 12:43:34.418 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_front_1: Calculated power:0.64000000000000001332267629550187848508358001708984375
2023-05-08 12:43:34.418 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: State changed to "on". Power:0.64
2023-05-08 12:43:34.423 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.living_room_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.livingroom_front_3_energy,sensor.livingroom_back_4_energy,sensor.mushroom_lamp_energy,sensor.livingroom_back_3_energy,sensor.livingroom_back_1_energy,sensor.livingroom_window_1_energy,sensor.livingroom_front_2_energy,sensor.livingroom_back_2_energy,sensor.livingroom_front_4_energy)
2023-05-08 12:43:34.424 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.indoor_lights_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.hallway_downstairs_1_energy,sensor.laundry_room_window_energy,sensor.livingroom_back_3_energy,sensor.livingroom_front_2_energy,sensor.livingroom_back_2_energy,sensor.bedroom_ceiling_energy,sensor.bathroom_downstairs_mirror_energy,sensor.livingroom_front_3_energy,sensor.family_room_window_1_energy,sensor.mushroom_lamp_energy,sensor.livingroom_window_1_energy,sensor.livingroom_front_4_energy,sensor.bedroom_window_energy,sensor.office_led_strip_energy,sensor.kitchen_table_energy,sensor.conservatory_ceiling_energy,sensor.hallway_upstairs_window_energy,sensor.hallway_downstairs_bench_energy,sensor.hallway_downstairs_2_energy,sensor.rice_lamp_energy,sensor.hallway_downstairs_entrance_energy,sensor.bedroom_right_energy,sensor.livingroom_back_4_energy,sensor.kitchen_window_1_energy,sensor.livingroom_back_1_energy,sensor.bedroom_left_energy,sensor.kitchen_lamp_energy)
2023-05-08 12:43:35.249 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:43:35.249 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:43:35.249 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:43:35.921 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: State changed to "off". Power:0.30
2023-05-08 12:43:37.235 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:43:40.333 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_front_1: Looking up power usage for bri:1 mired:331
2023-05-08 12:43:40.333 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_front_1: Calculated power:0.64000000000000001332267629550187848508358001708984375
2023-05-08 12:43:40.333 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: State changed to "on". Power:0.64
2023-05-08 12:43:44.464 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_front_1: State changed to "off". Power:0.30
2023-05-08 12:43:56.228 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:43:56.228 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:43:56.228 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:43:58.229 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:44:20.486 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_4: Looking up power usage for bri:1 mired:328
2023-05-08 12:44:20.486 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_4: Calculated power:0.64000000000000001332267629550187848508358001708984375
2023-05-08 12:44:20.487 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_4: State changed to "on". Power:0.64
2023-05-08 12:44:20.490 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.living_room_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.livingroom_front_3_energy,sensor.mushroom_lamp_energy,sensor.livingroom_back_3_energy,sensor.livingroom_back_1_energy,sensor.livingroom_window_1_energy,sensor.livingroom_front_2_energy,sensor.livingroom_back_2_energy,sensor.livingroom_front_4_energy)
2023-05-08 12:44:20.491 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.indoor_lights_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.hallway_downstairs_1_energy,sensor.laundry_room_window_energy,sensor.livingroom_back_3_energy,sensor.livingroom_front_2_energy,sensor.livingroom_back_2_energy,sensor.bedroom_ceiling_energy,sensor.bathroom_downstairs_mirror_energy,sensor.livingroom_front_3_energy,sensor.family_room_window_1_energy,sensor.mushroom_lamp_energy,sensor.livingroom_window_1_energy,sensor.livingroom_front_4_energy,sensor.bedroom_window_energy,sensor.office_led_strip_energy,sensor.kitchen_table_energy,sensor.conservatory_ceiling_energy,sensor.hallway_upstairs_window_energy,sensor.hallway_downstairs_bench_energy,sensor.hallway_downstairs_2_energy,sensor.rice_lamp_energy,sensor.hallway_downstairs_entrance_energy,sensor.bedroom_right_energy,sensor.kitchen_window_1_energy,sensor.livingroom_back_1_energy,sensor.bedroom_left_energy,sensor.kitchen_lamp_energy)
2023-05-08 12:44:22.374 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_4: State changed to "off". Power:0.30
2023-05-08 12:44:29.930 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:44:29.930 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:44:29.930 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:44:31.917 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26
2023-05-08 12:44:43.370 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Looking up power usage for bri:20 mired:250
2023-05-08 12:44:43.370 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.floor_lamp: Calculated power:1.004000000000000003552713678800500929355621337890625
2023-05-08 12:44:43.370 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "on". Power:1.00
2023-05-08 12:44:45.324 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.floor_lamp: State changed to "off". Power:0.26

@gribber At least all the errors disappeared now, which is promising.
The clue is here:
2023-05-08 12:44:20.490 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.living_room_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.livingroom_front_3_energy,sensor.mushroom_lamp_energy,sensor.livingroom_back_3_energy,sensor.livingroom_back_1_energy,sensor.livingroom_window_1_energy,sensor.livingroom_front_2_energy,sensor.livingroom_back_2_energy,sensor.livingroom_front_4_energy)
It's a precaution I added to avoid energy sensor getting negative. It will check if there is a previous reading of this sensor (before it went unavailable). When it doesn't it will raise this warning.
Will need to dig in this some more to see if this is really necessary or I could just ignore this. Has been a few weeks ago I added this code.
Could you try making them available one time and see if the energy sensor starts working after that?

livingroom_front_3_energy

Yep, it came back again when they all are available for that area, statistics still messed up but I guess I have to update the database to make them correct again
The question is how to handle this further on, lamps will continue to move to other rooms, get connected/disconnected by season and replaced when broken
For groups, in my opinion, statistics should remain what ever it was before entities got disconnected/moved and not reduced by the amount of energy that entity already consumed
On the other hand, I don't want the new group to grow by the same amount energy already used by a entity if it's moved
The entity itself, unless deleted/recreated should keep whatever stats it has regardless of area
Feels a bit tricky to solve, more work than just sum up entities in a area

Previously it would just sum up every entity in the group.
In the new implementation v1.6.0 it will calculate a delta for each entity.
It saves previous entity state of individual entities in config/.storage/powercalc_group.
When one of the group entities changes state it will lookup the last state there and calculate the delta, so the group sensor only increases. Regardless of unavailable entities or removal/addition of entities in the group.
It should handle the cases you mentioned.
But it's hard to get right and to forsee all the edge cases.

Previously it would just sum up every entity in the group.
In the new implementation v1.6.0 it will calculate a delta for each entity. It saves previous entity state of individual entities in config/.storage/powercalc_group. When one of the group entities changes state it will lookup the last state there and calculate the delta, so the group sensor only increases. Regardless of unavailable entities or removal/addition of entities in the group.
It should handle the cases you mentioned.
But it's hard to get right and to forsee all the edge cases.

Oh I see, if I understand that correct, it should work as I want :-)
So what's left is groups with unavailable lights still has state unavailable (and groups which included groups with that problem)
got lots of these now:

2023-05-08 14:11:53.268 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.livingroom_back_1_energy: -0.001399999999999999985775267497
2023-05-08 14:11:53.268 WARNING (MainThread) [custom_components.powercalc.sensors.group] skipping state for sensor.livingroom_back_1_energy, probably erroneous value or sensor was reset
2023-05-08 14:11:53.268 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.living_room_energy: New value: 1.810500000000000000000000000
2023-05-08 14:11:53.269 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.indoor_lights_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.kitchen_lamp_energy,sensor.kitchen_table_energy,sensor.kitchen_window_1_energy,sensor.laundry_room_window_energy)
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_2: Looking up power usage for bri:1 mired:328
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_2: Calculated power:0.64000000000000001332267629550187848508358001708984375
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_2: State changed to "on". Power:0.64
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_3: Looking up power usage for bri:1 mired:328
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_3: Calculated power:0.64000000000000001332267629550187848508358001708984375
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_3: State changed to "on". Power:0.64
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_4: Looking up power usage for bri:1 mired:328
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.strategy.lut] light.livingroom_back_4: Calculated power:0.64000000000000001332267629550187848508358001708984375
2023-05-08 14:11:53.270 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.livingroom_back_4: State changed to "on". Power:0.64
2023-05-08 14:11:53.275 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.living_room_energy: Recalculate, current value: 1.8105
2023-05-08 14:11:53.275 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.livingroom_back_2_energy: -0.001399999999999999985775267497
2023-05-08 14:11:53.275 WARNING (MainThread) [custom_components.powercalc.sensors.group] skipping state for sensor.livingroom_back_2_energy, probably erroneous value or sensor was reset
2023-05-08 14:11:53.276 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.livingroom_back_4_energy: -0.001399999999999999985775267497
2023-05-08 14:11:53.276 WARNING (MainThread) [custom_components.powercalc.sensors.group] skipping state for sensor.livingroom_back_4_energy, probably erroneous value or sensor was reset
2023-05-08 14:11:53.277 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.livingroom_back_3_energy: -0.001399999999999999985775267497
2023-05-08 14:11:53.277 WARNING (MainThread) [custom_components.powercalc.sensors.group] skipping state for sensor.livingroom_back_3_energy, probably erroneous value or sensor was reset
2023-05-08 14:11:53.277 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.floor_lamp_energy: 0E-61

every entity seems to have messed up (negative) values now, the statistics can be fixed by the tool in developer tools, but the state I guess have to be fixed by a database update
either way, it's above 100 entities 😓

Did you have messed up values before upgrade to v1.6.0-beta or after upgrade?
Regarding:
delta for entity sensor.livingroom_back_2_energy: -0.001399999999999999985775267497
It's comparing the current state of sensor.livingroom_back_2_energy to the last state saved in config/.storage/powercalc_group. When this is negative I just throw a warning so the group value won't go negative.
Not sure how the current value of this sensor can be lower than the previous. Might need some more debug logging to find tha`t out.

Before, but not at the 2023.5.0 update, this morning for some reason, at 8.50, almost every entity got reset except this: https://github.com/gribber/ha/blob/6c70c9f2a654a082f69f3ba8c8297dcd3913cdef/sensors/powercalc.yaml#L160-L179 which is all fine and got correct values and this: https://github.com/gribber/ha/blob/6c70c9f2a654a082f69f3ba8c8297dcd3913cdef/sensors/powercalc.yaml#L54-L58 which got was fine, then got reset at 14:05 (a little more than 1h after update)
I'm confused

It does say this:
2023-05-08 14:09:33.664 DEBUG (MainThread) [custom_components.powercalc.sensors.abstract] Binding sensor.bathroom_downstairs_mirror_energy to device a2282cdb5f629eaf14e8bcd59a1fc166
2023-05-08 14:09:33.664 WARNING (MainThread) [homeassistant.components.integration.sensor] sensor.bathroom_downstairs_mirror_energy could not restore last state unavailable: [<class 'decimal.ConversionSyntax'>]
2023-05-08 14:09:33.667 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.bathroom_energy: Restoring state: 16.0513

so it seems to fail to restore in some way
the group in which this light exist (this is the only one is this group)
2023-05-08 14:19:33.252 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.bathroom_energy: Recalculate, current value: 16.0513
2023-05-08 14:19:33.252 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.bathroom_downstairs_mirror_energy: -16.05120000000000100043458760
2023-05-08 14:19:33.252 WARNING (MainThread) [custom_components.powercalc.sensors.group] skipping state for sensor.bathroom_downstairs_mirror_energy, probably erroneous value or sensor was reset
2023-05-08 14:19:33.252 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.bathroom_energy: New value: 16.0513

the state value of this group is correct and has not been reset
attaching the logs
home-assistant_2023-05-08T13-35-49.946Z.log

Hard to say why your sensors gets reset all of a sudden in the past, I have no clue, sorry.

2023-05-08 14:09:33.664 WARNING (MainThread) [homeassistant.components.integration.sensor] sensor.bathroom_downstairs_mirror_energy could not restore last state unavailable: [<class 'decimal.ConversionSyntax'>]

This is actually a problem of the home assistant riemann integral component.
Which bugs on unavailable state. This should be reported at HA issue tracker.
But this is not a problem per se. On startup it tries to set the energy sensor to the last known state (which was unavailable), and it stays unavailable so that's not really an issue. Also it's only a warning.
What happens if you make the sensor sensor. bathroom_downstairs_mirror_energy available again.
Does it start adding values to the group again?
And does it turn this line positive again?
2023-05-08 14:19:33.252 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.bathroom_downstairs_mirror_energy: -16.05120000000000100043458760

Hard to say why your sensors gets reset all of a sudden in the past, I have no clue, sorry.

2023-05-08 14:09:33.664 WARNING (MainThread) [homeassistant.components.integration.sensor] sensor.bathroom_downstairs_mirror_energy could not restore last state unavailable: [<class 'decimal.ConversionSyntax'>]

This is actually a problem of the home assistant riemann integral component. Which bugs on unavailable state. This should be reported at HA issue tracker. But this is not a problem per se. On startup it tries to set the energy sensor to the last known state (which was unavailable), and it stays unavailable so that's not really an issue. Also it's only a warning.
What happens if you make the sensor sensor. bathroom_downstairs_mirror_energy available again. Does it start adding values to the group again? And does it turn this line positive again?
2023-05-08 14:19:33.252 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.bathroom_downstairs_mirror_energy: -16.05120000000000100043458760

This is what happens if I turn that light on
2023-05-08 16:15:21.436 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bathroom_downstairs_mirror: State changed to "on". Power:12.30
2023-05-08 16:15:21.439 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.bathroom_energy: Recalculate, current value: 16.0570
2023-05-08 16:15:21.439 DEBUG (MainThread) [custom_components.powercalc.sensors.group] delta for entity sensor.bathroom_downstairs_mirror_energy: 0.0001000000000000002622901895677
2023-05-08 16:15:21.439 DEBUG (MainThread) [custom_components.powercalc.sensors.group] sensor.bathroom_energy: New value: 16.05710000000000000026229019
2023-05-08 16:15:21.439 WARNING (MainThread) [custom_components.powercalc.sensors.group] sensor.indoor_lights_energy: One or more members of the group are unavailable, setting group to unavailable (sensor.kitchen_lamp_energy,sensor.kitchen_table_energy,sensor.kitchen_window_1_energy,sensor.laundry_room_window_energy)
2023-05-08 16:15:31.515 DEBUG (MainThread) [custom_components.powercalc.sensors.power] light.bathroom_downstairs_mirror: State changed to "off". Power:1.20

Nothing else in the logs regarding this
Both sensors (the light and the group) continues to count

That increase of energy sensor looks good.
I will have a look into One or more members of the group are unavailable.
Have an idea how to improve upon that.
It should not make the group unavailable when only a few sensors are unavailable. But just skip these from adding delta values to the energy sensor.
Will probably have a look tonight and issue a new beta.

Just released a new beta which should hopefully also resolve the unavailable issue for the energy group for you.
v1.6.0-beta.10

Just released a new beta which should hopefully also resolve the unavailable issue for the energy group for you. v1.6.0-beta.10

Solved the problem here after updating to v1.6.0-beta.10
It has appears other errors, but I need to investigate the origin if it is related or not.
2023-05-08 17:57:08.721 ERROR (MainThread) [custom_components.powercalc.helpers] Could not convert power value float(0) to decimal

@daniperaleda I did have a look and this error is raised when the fixed power strategy returns 0 as the power. However that should just be a legit case and not cause an error.
I will have a look into this.
I don't think it will break anything or cause malfunction though as things are also handled later on.

@daniperaleda I cannot reproduce this. Could you please create a new issue for this and add your configuration of fixed power sensors. Do you use some template which is returning "float(0)" literaly? We'll discuss further in other issue to not hijack this one.

FIXED...I have reviewed the configuration...it was a TEMPLATE POWER CALCULATE sensor...and it has a "{" missing...so it got a literal not a number....so OK for everything.

FIXED...I have reviewed the configuration...it was a TEMPLATE POWER CALCULATE sensor...and it has a "{" missing...so it got a literal not a number....so OK for everything.

Cool glad you got that resolved. will add some validations on correct template #1666.

I can confirm it work here as well

Is there a way to manually update the values of each energy sensor, at least the groups, which doesn't mess things up?

Is there a way to manually update the values of each energy sensor, at least the groups, which doesn't mess things up?

I'm afraid not.
Will need to do some DB queries to correct things. Because statistics are calculated by looking at previous statistic. When it is wrong at a certain point it won't be corrected.
Do you use MariaDB or SQLite?
You can have a look into statistics, statistics_short_term and states tables for one problematic entity and see where the problem is, where the data got "corrupted".
Maybe I can help suggest a way to correct that on your HA installation.

Is there a way to manually update the values of each energy sensor, at least the groups, which doesn't mess things up?

I'm afraid not. Will need to do some DB queries to correct things. Because statistics are calculated by looking at previous statistic. When it is wrong at a certain point it won't be corrected. Do you use MariaDB or SQLite? You can have a look into statistics, statistics_short_term and states tables for one problematic entity and see where the problem is, where the data got "corrupted". Maybe I can help suggest a way to correct that on your HA installation.

Using mariadb, the statistics can be fairly easy corrected in the gui (dev tools - > statistics), at least I think that's enough, so it's the state that needs update
The db layout seems to have changed since last time I had to some something similar

Closing this issue as there were also fixes in HA core latest versions regarding energy sensors misbehaving (going negative and things like that).


Fix error handling in Response.get_content() with test cases

Resolves issue #42.

Codecov Report

Merging #43 into master will increase coverage by 56.86%.
The diff coverage is 96.77%.

@@             Coverage Diff             @@
##           master      #43       +/-   ##
===========================================
+ Coverage    0.28%   57.14%   +56.86%
===========================================
  Files          34       35        +1
  Lines         713      742       +29
===========================================
+ Hits            2      424      +422
+ Misses        711      318      -393

Impacted Files
Coverage Δ

tests/request/core/test_base.py
96.55% <96.55%> (ø)

snow/request/core/base.py
53.62% <100.00%> (+53.62%)
:arrow_up:

snow/request/helpers/stream.py
34.48% <0.00%> (+34.48%)
:arrow_up:

snow/resource/__init__.py
35.16% <0.00%> (+35.16%)
:arrow_up:

snow/resource/query/utils.py
36.36% <0.00%> (+36.36%)
:arrow_up:

snow/request/core/get.py
41.66% <0.00%> (+41.66%)
:arrow_up:

snow/request/helpers/update.py
42.10% <0.00%> (+42.10%)
:arrow_up:

snow/resource/query/condition.py
42.85% <0.00%> (+42.85%)
:arrow_up:

... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f838a0...900c59d. Read the comment docs.

LGTM :+1:


New extend feature breaks including translations before i18n.js

The new translation extending feature introduced in #354 broke the use case where the translation files are included before I18n.js. If you were doing that, you now get an error because I18n.extend isn't defined.
Uncaught TypeError: I18n.extend is not a function
This feature made it much easier to keep i18n.js integrated into a JS build, with the translation files included first.
I can attempt a pull request, but I'm not sure what the best solution is.
My initial ideas were:

Make the extending optional
Make the translation output templatable

I lean towards the second option as it solves the issue and gives more flexibility for how the translation files are used in various kinds of projects.

Why would I18n.extend become undefined?
Because it's not detecting the existing the I18n object & adding the method to it?

Hey,
I got the same issue today when upgrading from rc11 to rc12.
I am bundling i18n.js into my main js file and loading the translations depending on current locale before that.
This results in I18n.extend not being available when the translation file is processed.
    <script src="/assets/i18n/de-d4582a091c6a984386c5bc2a8f9b3611.js"></script>
    <script src="/assets/application-64dbf72160f28757ea63a8148cddd595.js"></script>

I have no good idea to solving this right now, I could supply my own implementation of I18n.extend, but that feels more like a hack.
In the meantime I will go back to using rc11.

Sorry @PikachuEXE, yes, @1st8 has the same use case as me. i18n.js is included after the translation files, which reference I18n.extend.

@AntiFish03 Can you take a look and try to figure out what goes wrong?

@PikachuEXE, this would be the same issue if you tried to use $ before you've loaded jQuery.  You have to load the library before it will work... Extending translations just means that instead of the translations stomping all over each other they can now be broken into smaller pieces and loaded with their respective components. It gives the ability to leverage smaller chunks at one time, And possibly load considerably less code per page that you might not actually be using.
As far as a way to turn it off or change the output to a template there are definitely ways to do that but I think that it would greatly increase the complexity of I18n-js even more than it is.  This is your project I submitted this change to try and help a project that I am using (and because I needed the ability to load smaller component sized translation files without them stomping all over each other).

Let me think about the best way to deal with this...
But I am too busy rushing on my job this week so you guys might need to wait for a while :S

At a minimum we should make this new option configurable. Please merge my PR: https://github.com/fnando/i18n-js/pull/397

@johnnyshields I will review it on Monday
Thanks for the PR!

Can you all with this issue try master now since #397 is merged?

Note on master to disable the extend you need to add:
js_extend: false

To the top of your I18n.yml.

@johnnyshields
Seems easier to give them a link :P
https://github.com/fnando/i18n-js#javscript-deep-merge-js_extend-option

* https://github.com/fnando/i18n-js#javascript-deep-merge-js_extend-option


Minor formatting proposals

Thank you for your suggestions.
Unfortunately, you'll have to sign a contributor license agreement before we can accept your contribution


add to pypi

Now that I'm trying to use this on micrscopes it would be nice to be able to pip install specific versions.

have you tried pip install git+https://github.com/tlambert03/napari-micromanager.git@<commit>

I added a release candidate to pypi: https://pypi.org/project/napari-micromanager/
we can version things and update their... might stick with release candidate versions until certain things are more stable  (particularly things like #33)

makes sense to me - thanks!


server crash with Carpet and cardinal

https://gist.github.com/drakosoldier298/00b71976e5a2df03664f7b37e930adcc
This is a log from a server on apex so custom.jar is fabric
originally thought to be an issue with an incompatibility between fabrication and carpet but both said it was cardinal components

Hmm no it does seem like the issue comes from a carpet mixin. I don't see how CCA could be responsible for a mixin failure.


[Hub Generated] Review request for Microsoft.DBforPostgreSQL to add version preview/2023-03-02-preview

This is a PR generated at OpenAPI Hub. You can view your work branch via this link.
ARM (Control Plane) API Specification Update Pull Request
PR review workflow diagram
Please understand this diagram before proceeding. It explains how to get your PR approved & merged.

[1] ARM review queue (for merge queues, see [4])
The PRs are processed by time opened, ascending. Your PR may show up on 2nd or later page.
If you addressed Step 1 from the diagram and your PR is not showing up in the queue, ensure the label ARMChangesRequested
is removed from your PR. This should cause the label WaitForARMFeedback to be added.
[2] https://aka.ms/azsdk/support/specreview-channel
[3] List of SDK breaking changes approvers in pinned Teams announcement
[4] public repo merge queue, private repo merge queue (for ARM review queue, [1])
If you need further help with anything, see Getting help section below.
Purpose of this PR
What's the purpose of this PR? Check all that apply. This is mandatory!

[x] New API version. (Such PR should have been generated with OpenAPI Hub, per this wiki doc.)
[ ] Update existing version for a new feature. (This is applicable only when you are revising a private preview API version.)
[ ] Update existing version to fix swagger quality issues in S360.
[ ] Other, please clarify:

edit this with your clarification

Due diligence checklist
To merge this PR, you must go through the following checklist and confirm you understood
and followed the instructions by checking all the boxes:

[x] I confirm this PR is modifying Azure Resource Manager (ARM) related specifications, and not data plane related specifications.
[x] I have reviewed following Resource Provider guidelines, including
ARM resource provider contract and
REST guidelines (estimated time: 4 hours).
I understand this is required before I can proceed to Step 2, "ARM Review", for this PR.

Breaking changes review (Step 1)

If the automation determines you have breaking changes, i.e. Step 1 from the diagram applies to you,
you must follow the breaking changes process.
IMPORTANT This applies even if:

The tool fails while it shouldn't, e.g. due to runtime exception, or incorrect detection of breaking changes.
You believe there is no need for you to request breaking change approval, for any reason.
Such claims must be reviewed, and the process is the same.

ARM API changes review (Step 2)

If this PR is in purview of ARM review then automation will add the ARMReview label.
If you want to force ARM review, add the label yourself.
Proceed according to the diagram at the top of this comment.

Viewing API changes
For convenient view of the API changes made by this PR, refer to the URLs provided in the table
in the Generated ApiView comment added to this PR. You can use ApiView to show API versions diff.
Suppressing failures
If one or multiple validation error/warning suppression(s) is detected in your PR, please follow the
Swagger-Suppression-Process
to get approval.
Getting help

For general PR approval workflow, see the diagram at the top of this comment.
For guidance on fixing this PR CI check failures, see the hyperlinks provided in given failure
and https://aka.ms/ci-fix.
If the help provided by the previous points is not enough, post to https://aka.ms/azsdk/support/specreview-channel and link to this PR.

/azp run unifiedPipeline

MISSING_APIS_IN_DEFAULT_TAG errors in Swagger Avocado pipeline are due to namespace changing from "Microsoft.DBForPostgreSql" in 2020-10-05-privatepreview version to "Microsoft.DBforPostgreSQL" which the latter one is the correct version which's been used in both stable 2022-11-08 version the version we'll publish currently, 2023-03-02-preview.

Hello @rkmanda ,
MISSING_APIS_IN_DEFAULT_TAG errors in Swagger Avocado pipeline are due to namespace changing from "Microsoft.DBForPostgreSql" in 2020-10-05-privatepreview version to "Microsoft.DBforPostgreSQL".
The 2020-10-05-privatepreview version was mistakenly pushed to this repository and was not released to customers. The latter one is the correct version which's been used in both stable 2022-11-08 version the version we'll publish currently, 2023-03-02-preview.

    "entraIdPrincipal": {

I think we shouldn't put the brand 'entra' in the API. Rebranding will make the API naming age ungracefully...
Instead, let's consider we can call it something more like 'identity'

Refers to: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-02-preview/postgresqlhsc.json:2621 in 4caf250. [](commit_id = 4caf2507ca2d5cb006c09f4d2c6695dc47687c78, deletion_comment = False)

    },

Please note that booleans are hard to extend and not future proof, so discouraged. Consider using an enum or other optional property instead.

Refers to: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-02-preview/postgresqlhsc.json:2610 in 4caf250. [](commit_id = 4caf2507ca2d5cb006c09f4d2c6695dc47687c78, deletion_comment = False)

    "password": {

Great to see it won't be required!
How will someone know whether it was ever set or not though? Since you can't see a password set in the response.
Consider having a flag to say whether password auth is enabled or disabled, or just documenting the fact if its always implicitly disabled any time an identity is used.

Refers to: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/preview/2023-03-02-preview/postgresqlhsc.json:2611 in 4caf250. [](commit_id = 4caf2507ca2d5cb006c09f4d2c6695dc47687c78, deletion_comment = False)

Hello @TimLovellSmith,
I applied recommended changes to the PR. I also updated the resource manager backend code in the meantime.

Changed isAdmin boolean type to enum roleType
Updated description for password to emphasize if an identity is used, password will not be required&used.
Changed entraIdPrincipal to externalIdentity to make if future proof.

Thank you for your review!


Window to confirm user wants to delete slide, or option to undo delete slide action

+1, We can use the default confirmation modal


Update README.md

Replace prusaslicer with orcaslicer(an updated fork of prusaslicer)

Thanks, but I'll probably stick with prusaslicer in the list of recommendations. It's
still well-maintained and developed/supported by a reputable vendor.


Credits

All have been restored in your name.
In the places where we have improved code, we have noted and displayed it within the code. also, we see that you have updated your repo name from “sparx-notes” to “magic-notes” at this time. I ask why this has been done.
No harm or discredit intended, we ask if we can continue with our repo based off your code, credits will be given.
Finally, you marked my version of the code as “Malicious”, Please mark areas of my version that are malicious.

Hi, thank you for being kind :)
You can use the code and modify it as you wish, just add my original credits and add 'Modified by: Najm Ajmal'. You should probably add a comment linking the code back to my repo too:
Credits: https://github.com/alexlostorto/magic-notes
I changed the repo from 'sparx-notes' to 'magic-notes' to avoid infringing on any copyright that Sparx LTD are entitled to. Feel free to check their Terms and Conditions - you may be liable to any damages for naming your program 'sparxmaths solver'.
I checked your code and everything seems safe, I will close all of my issues.
PS - nice website 🙃

Thank you for letting me modify your code. I appreciate the opportunity to learn from your approach and implement my own ideas. As we continue to develop our code independently, we can inspire each other to improve and refine our skills.


Revert "Update sbt-github, sbt-github-header, ... to 0.10.0"

Reverts higherkindness/skeuomorph#517

Retroactive approval :+1:


SPI broken for STM32L1

Describe the bug
With the current Zephyr master, SPI is not working as expected on STM32L1 based 96boards Wistrio board. Some of the bytes of the received data seems to be dropping.
To Reproduce
Reproducible with the LoRa PR #18998 which uses SPI for communicating to the Radio.
The issue seems to be with this commit: https://github.com/zephyrproject-rtos/zephyr/commit/2ce8fa1e42d3d60e4119f15e82c29d2daaf67c00
To be more precise, setting xfer_16 flag manually to false fixes the issue, which means the problem is with sending/receiving 16bits of data.

@psidhu Since you are the actual author of the commit, could you please look into this?

@Mani-Sadhasivam, thanks for reporting. This is partly my bad, not enough tests have been made for this behavior to be made used by default.
@psidhu, can you push a change to set this behavior available only under specific Kconfig flag (default n)?

@erwango Sure, though it may take me a small bit of time to get to.


python3Packages.userpath: init at 1.4.1

Motivation for this change
userpath is a cross-platform tool for adding locations to the user PATH. It is required to package a very useful python tool pipx, which allows to install and run python applications in isolated environments.
Things done

[X] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[X] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[X] Fits CONTRIBUTING.md.

Good, thx for the review


First iteration on sharding support

Codecov Report

Merging #162 into devel will increase coverage by 1.46%.
The diff coverage is 39.3%.

@@             Coverage Diff              @@
##              devel     #162      +/-   ##
============================================
+ Coverage     16.86%   18.33%   +1.46%
- Complexity     1360     1513     +153
============================================
  Files           750      780      +30
  Lines         26509    26823     +314
  Branches       2331     2340       +9
============================================
+ Hits           4472     4917     +445
+ Misses        21727    21572     -155
- Partials        310      334      +24

Impacted Files
Coverage Δ
Complexity Δ

...a/com/torodb/backend/BackendConfigImplBuilder.java
0% <ø> (ø)
0 <0> (ø)
:x:

...in/java/com/torodb/core/bundle/AbstractBundle.java
0% <ø> (ø)
0 <0> (?)

...ds/signatures/diagnostic/ListDatabasesCommand.java
4.76% <ø> (+4.76%)
2 <0> (+2)
:white_check_mark:

...src/main/java/com/torodb/torod/SqlTorodConfig.java
100% <ø> (ø)
2 <0> (ø)
:x:

.../java/com/torodb/core/bundle/BundleConfigImpl.java
0% <ø> (ø)
0 <0> (?)

...in/java/com/torodb/core/backend/BackendBundle.java
0% <ø> (ø)
0 <0> (ø)
:x:

...ain/java/com/torodb/core/bundle/ServiceBundle.java
0% <ø> (ø)
0 <0> (?)

...ain/java/com/torodb/backend/BackendConfigImpl.java
0% <ø> (ø)
0 <0> (ø)
:x:

...n/java/com/torodb/backend/guice/BackendModule.java
0% <ø> (ø)
0 <0> (ø)
:x:

...db/repl/impl/FollowerSyncSourceProviderBundle.java
0% <ø> (ø)
0 <0> (ø)
:x:

... and 226 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 624353e...7dc26f7. Read the comment docs.


[Accessibility] The images besides the paper don't have alt-tags.

The images besides the paper don't have alt-tags.
Solution: Provide alternate description to the images.

@SushantKafle There is no information available for the images so we can only add something generic like "A representative figure from paper ..."

@SushantKafle Let me know if the commit referenced above works and I will open a PR. Thanks.

@anaerobeth If you have time to implement this, your proposal sounds good to me!


Add tests for indent scripts option

Fixes #1518
*Add indent_scripts to README
I went back and plugged it into v1.7.5 and nothing changed.

Thanks @MacKLess!


scaffold multiple dbcontext for the same model

I have a  project where i need  to use two differents databases of the same Sql server connection .
For the first database i used the DatabaseFirstApproach which is common for all users.
The second database is specific for each user , but it is identic in it's schema ,there are many databases in sql server.
My question is , how to add these databases in my project ?
they have the same schema , so they should have the same model, can we create a shared model for differents databases with ef core ?

                  Model  db1 db2 db3 db4 db5 db6 db7 db8 db9 db10

should i add them all with database first approach  ? that would make the project  structure repetitive (the same models would be repeated many times)!
for each client in my application, i would use this code :
 //Connect with the selected customer's connection string
          using (SqlConnection ccn = new SqlConnection(EConnectionString.ToString()))
        {
            DateTime lastDayinTheYear = new DateTime(DateTime.Now.Year, 12, 31);
            GetListEntrepriseActivitesByPeriode(ccn,IdEnterprise, DateTime.Now, lastDayinTheYear);

        };

solved here