Sinope Line Voltage Thermostats

I see, I think we need to create sensor specific for energy usage attribute of the device and add that sensor into the energy dashboard. I’ll try to add sensor creation directly in the custom_components. This is my next improvement for my custom_components. Meanwhile just create the sensor you need and add them to the energy.

That’s a good way easier then tracking ieee

That would be amazing if you could do that… It would be really nice just to see that data in the native energy monitoring in HA.

I’m not exactly a wiz when it comes to coding, most of the devices in my home have nice ui based implementations but I’m getting some error/warning messages from the sinope setup, so maybe I missed a step somewhere?

For context, I’m running on HAOS, Raspberry Pi 4b, freshly created from pi imager yesterday.

First there’s this warning: HomeAssistantType was used from sinope, this is a deprecated alias which will be removed in HA Core 2025.5. Use homeassistant.core.HomeAssistant instead, please report it to the author of the ‘sinope’ custom integration.

Then this error: Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:356
integration: Climate (documentation, issues)
First occurred: 4:40:29 PM (1 occurrences)
Last logged: 4:40:29 PM

Error while setting up sinope platform for climate

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 356, in _async_setup_platform await asyncio.shield(awaitable) File “/config/custom_components/sinope/climate.py”, line 204, in async_setup_platform dev_list.append(json.loads(line)) ^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/json/init.py”, line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/json/decoder.py”, line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/usr/local/lib/python3.12/json/decoder.py”, line 355, in raw_decode raise JSONDecodeError(“Expecting value”, s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)

I get the same error for switch and light but I only have line voltage thermostats connected through a GT125.

Edit: Something must have gone sideways in the sinope_devices.json file because renaming and recreating it looked the same to me but works now.

So, aside from a “taking longer than 10 seconds to start” warning, is there any indication that the devices are actually enabled? I kind of expected there to be devices or an integration icon added to the graphics. Is it only accessible though coding?

Hi @LoganFraser, first the message about HomeAssistantType won’t prevent the sinope GT125 to load the devices. I’m working to fix this soon. HA is doing a lot of code cleanup and they deprecate many thing that we need to change but we still have until 2025 to fix it.
The other message about line 204, in async_setup_platform is because your file sinope_device.json was wrong. You should use device.py to create that file. You can edit it to change the device names but you must be carefull not to break it.
Finally to see if your devece is loaded just look in dev tools / state to find your device like climate.sinope_climate_… If it is loaded you will see values as temperature etc If it is not you will see unavailable.
I’m gona push a new release this weekend to fix those messages about HomeAssistantType.

Yep, got that part working. Is there a way to have it appear on the integration or devices list? I had to manually add the sinope to Hubitat as well but it showed up as devices with temperate settings in the GUI.

Just edit the dashboard and add a thermostat card. in the card add your device and it will showup

1 Like

Zigbee thermostats become unresponsive over time using z2mqtt, unoccupied/occupied status.
Hello everyone, and especially Claude! My Wife Approval Factor (WAF) is dropping fast on HA/Sinope.

I am using an automation in 2 rooms that when the aqara FP1 presence sensors detect presence after a few minutes they flip the occupied status of the thermostat. I then have set the occupied/unoccupied temperatures accordingly. This seems to work great for awhile until it doesn’t. I am not sure of the interval but it eventually stops working. The sinope thermostats stop responding to even manual attempts to set the occupancy status. The ui changes but if you refresh it is back to the same value. Can anyone advise how to go about troubleshooting this, or what could be the problem.

Automation:

From away to home trigger:

platform: state
entity_id:
  - binary_sensor.02_roomA_presence_01_presence
from: "off"
to: "on"
for:
  hours: 0
  minutes: 1
  seconds: 0

Action:

domain: select
entity_id: 12f155a02aa47768654d42caaf6acd44
type: select_option
option: occupied

From home to away after 10 mins trigger:

type: not_present
platform: device
device_id: f0aec6de4545fb9bad1cb73e316921d0
entity_id: binary_sensor.02_roomA_presence_01_presence
domain: binary_sensor
for:
  hours: 0
  minutes: 10
  seconds: 0

Action:

device_id: 41f6fd0dfc4470f616d6b167f1fa4b09
domain: select
entity_id: 12f155a02aa47768654d42caaf6acd44
type: select_option
option: unoccupied

Thanks in advance for help!

Hi @deep6, your first automation trigger is too short I think. You’ve set it for 1 minute. Youshould have a longer delay.
Also you don’t need to write

for:
  hours: 0
  minutes: 1
  seconds: 0

but just:

for:
    minutes: 1

To create a sensor use a template sensor:

template:
    -  sensor:
         - name: "cuisine_energy_usage"
           unique_id: sensor.cuisine_energy
           unit_of_measurement: "kWh"
           device_class: energy
           state_class: total_increasing
           state: "{{ state_attr('climate.neviweb130_climate_plancher_cuisin','hourly_kwh_count') }}"

You can put it in configuration.yaml or create a file template.yaml and add this to your configuration.yaml:
template: !include template.yaml
Then you can add your sensor.cuisine_energy to your energy dashboard.
Should work.

post your code for the sensor

Hi in your sensor you put the name of my thermostat. :slight_smile:```
climate.neviweb130_climate_plancher_cuisin

you need to replace it by the name of your thermostat
climate.neviweb130_climate_«your_thermostat»
This is why you get unknown for your sensor.

Hi Claude,

Are you thinking the trigger is getting missed? I don’t know if that’s the case, I’ll double check the detection to ensure it’s happening. The presence sensors are very fast. Re the extra lines that’s from the form editor. I converted to yaml for the post.

Thanks for the reply

Looking to your sensor

- name: "Den_energy_usage"
           unique_id: sensor.Den_energy

The name of your sensor is sensor.den_energy
In your energy dashboard you put sensor.den_energy_usage
change the name in the energy dashboard for sensor.den_energy or change your template sensor to have

- name: "Den_energy_usage"
           unique_id: sensor.Den_energy_usage

It should work.
To se the exact name of the sensor you’ve created go to dev tool / state and look for sensor.den***
You will se the exact name of your sensor

The problem could be from the way you detect presence /absence.
you put a 1 minutes delay for presence and 10 minutes for absence.
Your sensor is in the room and detect movement. If you go out and come back a minute later the 10 minutes delay is wrong.
Maybe you should find another way to detect presence like monitoring the cellphone when your home or away.

template:
    -  sensor:
         - name: "Den_energy_sensor"
           unique_id: sensor.den_energy_sensor
           unit_of_measurement: "kWh"
           device_class: energy
           state_class: total_increasing
           state: "{{ state_attr('climate.neviweb130_climate_Den','hourly_kwh_count') }}"

Then go to developer tools, states and look for your sensor.den_energy_sensor
There should be a value in the second column. If that work this is the name you need to import in the energy dashboard.

The state attribute looks wrong. Change it to your device.

@jdawson
Just replace the capital letter in your device name and sensor name like this
Den → den

state: “{{ state_attr(‘climate.neviweb130_climate_den’,‘hourly_kwh_count’) }}”

Make sure climate.neviweb130_climate_den exist in the developer tool / states

Then check in developer tool / states for the name of your sensor:

sensor.den_energy_sensor should exist and have a value in the state column.
If this is ok then your new sensor can be added in the energy dashboard.

1 Like

could it be possible his state attribute for hourly is below?
state: “{{ state_attr(‘climate.neviweb130_climate_den’,‘hourly_kwh’) }}”