Home Assistant : Q&A, Tips & Tricks, Your Configs

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,034
got it wokring by changing the trigger from "on" and to "off" seems it wasnt picking up the "clear" part
Then the "binary_sensor.motion_garage" isn't seen as a motion sensor class. Only reason I can think of why it uses "on" and "off" and not "Detected" and "clear"
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,034
Yeah all my binary sensors are between 'on' and 'off'.
Seems like it depends where you look...

When going to configuration, entities, binary.sensor.xxxxxxx, it shows as "Detected" and "clear".

When going to developer tools, state, binary.sensor.xxxxxxx, it shows as "on" and "off"

Strange that it shows 2 different states.

But correct, it should have been from "on" to "off". Sorry my mistake.
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
10,798
The on and off is standard and what you use in automations.

The motion and clear is based on the device_class of the entity but not used in automations. It's only to be user friendly in the ui.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,034
The on and off is standard and what you use in automations.

The motion and clear is based on the device_class of the entity but not used in automations. It's only to be user friendly in the ui.
Make sense...

I am using the device as trigger and then you can use clear and detected. When using an entity it will be on and off.
 

deesef

Expert Member
Joined
Mar 3, 2017
Messages
1,893
HA States are sometimes unnecessarily "strange". Another example is the home / away state. The entity changes between "home"and "away", but automations trigger on "home" and "not_home".

Designed to confuse...
 

Gielie01

Active Member
Joined
Mar 16, 2018
Messages
73
HA States are sometimes unnecessarily "strange". Another example is the home / away state. The entity changes between "home"and "away", but automations trigger on "home" and "not_home".

Designed to confuse...
Not that confusing once you realize most entities that have only 2 states are binary.
It gives you a "pretty" representation of that on the ui, but for the "back end" its still mostly binary and then home/not_home makes a lot of sense.

It comes down to a design principle, if you were to think of a garage door / gate.
Most people are happy knowing if the gate is open/closed.
But in reality, most people only cater for 1 of 2 scenarious.
Based on where you place a reed switch, you would know if the door is "closed/not_closed" vs "open/not_open".
To me those are 2 very different things

Having a garage door 5cm open means its not_closed, but its not open either, only a mouse would walk through that gap.
 

Concentric

Expert Member
Joined
Feb 16, 2017
Messages
1,013

Fyi if any of you want
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
1,722
I finally got my CBI Astute connected up to my geyser. Got the new tuya integration working, but if I toggle the switch to turn it on the geyser turns on and the toggle on HA goes back to the "off" position like in the pic after 1 sec or so. The geyser stays on but there is no way to put it off using HA. I have to open the Tuya Smart app and turn it off from there.

How do I fix this?

1633602333499.png
 

gbyleveldt

Senior Member
Joined
Apr 30, 2009
Messages
868
I finally got my CBI Astute connected up to my geyser. Got the new tuya integration working, but if I toggle the switch to turn it on the geyser turns on and the toggle on HA goes back to the "off" position like in the pic after 1 sec or so. The geyser stays on but there is no way to put it off using HA. I have to open the Tuya Smart app and turn it off from there.

How do I fix this?

View attachment 1162034
I believe there's still a few bugs in the latest Tuya HA integration; I read of this issue in the release notes today
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
1,722
I believe there's still a few bugs in the latest Tuya HA integration; I read of this issue in the release notes today

What other options do I have at the moment to get it working? besides your guide on flashing tasmota. Thats impossible for me lol
 

gbyleveldt

Senior Member
Joined
Apr 30, 2009
Messages
868
What other options do I have at the moment to get it working? besides your guide on flashing tasmota. Thats impossible for me lol
I'd give it a few days to be honest. Many people moaning about it so I suspect they'll get it sorted soonest. Not sure about alternatives to be honest; I have nothing Tuya here
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
1,722
I'd give it a few days to be honest. Many people moaning about it so I suspect they'll get it sorted soonest. Not sure about alternatives to be honest; I have nothing Tuya here

Thanks. Its in beta still so I guess bugs are to be expected. Wont be a biggie to wait. Ill just set some temporary automations to turn my geyser on in the tuya app
 

R4m80

Well-Known Member
Joined
Oct 31, 2014
Messages
335
Thanks. Its in beta still so I guess bugs are to be expected. Wont be a biggie to wait. Ill just set some temporary automations to turn my geyser on in the tuya app
I have mine set up with LocalTuya in HA and it works flawlessly.
 

ItherNiT

Senior Member
Joined
Jan 31, 2011
Messages
771

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
1,722
Yes.

The official Tuya integration is only from version core-2021.10.0


It's the reason I haven't upgraded yet, wanted to wait and see if it's working correctly.

Is it worth the effort to set up the local tuya for now till they fix the bugs?

At the moment I have my geyser set to come on and go off at set time using the tuya smart app and it's working.

Another question, can the cbi astute be configured to show up on the energy dashboard?
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
10,798
Is it worth the effort to set up the local tuya for now till they fix the bugs?

At the moment I have my geyser set to come on and go off at set time using the tuya smart app and it's working.
Yeah I am staying with localtuya until I am ready to rip the things apart and put esp chips in.

Another question, can the cbi astute be configured to show up on the energy dashboard?
Very much so yes.

Create a few template sensors:

So here is my localtuya config:
Code:
localtuya:
  ## CBI Astute Smart Switch
  - host: 192.168.241.150
    device_id: !secret geyser_mainbathroom_device_id
    local_key: !secret geyser_mainbathroom_local_key
    friendly_name: Main Bathroom Geyser
    protocol_version: "3.3"
    entities:
      - platform: switch
        friendly_name: Main Bathroom Geyser
        id: 1
      - platform: sensor
        friendly_name: Main Bathroom Geyser Current
        id: 21
        device_class: current
        unit_of_measurement: "mA"
      - platform: sensor
        friendly_name: Main Bathroom Geyser Power
        id: 23
        scaling: 0.1
        device_class: power
        unit_of_measurement: "W"
      - platform: sensor
        id: 22
        scaling: 0.1
        friendly_name: Main Bathroom Geyser Voltage
        device_class: voltage
        unit_of_measurement: "V"

This then creates a few entities but the one we want is sensor.main_bathroom_geyser_power which is the one showing the current watt usage, eg. 4000w +- for my 4kW geyser.

I then create the following template sensors, integration sensors, etc. Not all needed but the daily one eventually is picked up by the energy dashboard setup and allows you to add it.
Code:
sensor:
  # Sensor for Riemann sum of energy bought (W -> Wh)
  - platform: integration
    source: sensor.main_bathroom_geyser_power
    name: main_bathroom_geyser_usage
    unit_prefix: k
    round: 2
    method: left

utility_meter:
  main_bathroom_geyser_daily:
    source: sensor.main_bathroom_geyser_usage
    cycle: daily
  main_bathroom_geyser_monthly:
    source: sensor.main_bathroom_geyser_usage
    cycle: monthly

Here is how you see it in the UI config:
Screenshot 2021-10-08 at 06.46.12.png

Screenshot 2021-10-08 at 06.46.28.png

And finally here is my daily energy dash for yesterday:
Screenshot 2021-10-08 at 06.46.48.png
 

Fjorko

Expert Member
Joined
Jan 17, 2007
Messages
1,915
I finally got my CBI Astute connected up to my geyser. Got the new tuya integration working, but if I toggle the switch to turn it on the geyser turns on and the toggle on HA goes back to the "off" position like in the pic after 1 sec or so. The geyser stays on but there is no way to put it off using HA. I have to open the Tuya Smart app and turn it off from there.

How do I fix this?

View attachment 1162034
Look at this : Maybe you missed this step

 
Top