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

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
11,531
yes the switches are working. I can trigger both switches in Tasmota UI and on the Tasmota integration in HA I cant see the status switch though how do I add that in HA? in the integration Tasmota cant see it there.
this is what I can see in the integration of HA. Just need to add it to a cover card that will show status of both using the Switch2

View attachment 1314252

got it working with the below cover. Now I just need a better looking card. Is there a way to get the whole card change color depending on state?

Code:
cover:
  - platform: mqtt
    name: "Gate 1"
    state_topic: cmnd/gatestatus/POWER2
    command_topic: cmnd/gate/Power1
    availability_topic: tele/gate/LWT
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "OFF"
    state_closed: "ON"
    payload_available: "Online"
    payload_not_available: "Offline"
    optimistic: false
    qos: 0
    retain: false
  - platform: mqtt
    name: "Gate 2"
    state_topic: cmnd/gatestatus/POWER2
    command_topic: cmnd/gate/Power2
    availability_topic: tele/gate/LWT
    payload_open: "ON"
    payload_close: "ON"
    payload_stop: "ON"
    state_open: "OFF"
    state_closed: "ON"
    payload_available: "Online"
    payload_not_available: "Offline"
    optimistic: false
    qos: 0
    retain: false

View attachment 1314272
The status switch is not suppose to be an actual switch you use. It is suppose to only show the state if it is a reed switch.

If your device have 2 relays and a reed switch, then you need to have it show power1 2 and 3 in tasmota.
Then you use power3 as the state.

Let me explain how the sonoff sv works.
It has a single relay, shown as power1 in tasmota.
Then the reed switch (a sensor only) on gpio14, show as power2 in tasmota.
Even though it looks like a power switch, it does nothing except show on/off based on whether my gate is open or closed.

Thats why I am saying, if you 2 relays (I assume since you have 2 gates?), then you need to see 3x power switches in tasmota if you only have a single reed switch. Is this the state for both gates or just one gate?

I actually dont think I understand what you are doing, and thats probably why no one here is able to help you because we dont understand whats going with your setup.

As for the color state, once you add the buttons to a card in lovelace, edit the card settings there to change color based on state.

Screenshot 2022-05-24 at 07.52.09.png
 

n00bster

Well-Known Member
Joined
Nov 25, 2008
Messages
170
yes I understand how it works. All I was struggling with was the code to get the correct info into HA. I know that it is not a actually switch it is just a sensor I have added a binary sensor. In my case GPIO14 did not work I am using GPIO2.

as mentioned before I have 2 relays because 1 is for opening the gate so a car can get through and the other is for opening the same gate just for 1 person to go through. (Same Gate).

now I am just looking at getting it to look better than the card I posted. I just want 1 card again with 2 buttons and then when the binary sensor is open (Gate is open) the whole card will go Red.

busy playing around with the custom button card and styles.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,093
Spend the last day or 2 cleaning out and sorting my home assistant setup.

Used this https://github.com/dummylabs/thewatchman to look for missing entities and fixing automations that stopped working correctly due to triggers or conditions that doesn't function correctly. Also moved all my groups/input_... to the new helper section.

Not sure where and what was done, but the web interface is a lot more responsive, the system starts up a lot quicker as well. 1st time doing some proper maintenance on the setup, since started using it a few years ago.

Just as fyi if you move from yaml to the helper section and keep the name convention the same, for example if in yaml it was "rooms:" and you create an helper -> dropdown with name "rooms" it ends being the same entity id(input_select.rooms), it keeps all everything that was related to it, including history.
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
44,670
How would I get these two entities combined into one value?

1653474880991.png
1653474897925.png
1653474914022.png
Sunsynk inverter gives you each MPPT on it's own and I'd like a total PV Load value for automation use.
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
44,670
when you setup the energy card which entity did you use? On the solar assistant it give them seperately then another entity for the combined PV
Energy card uses kWh so it uses the total generated.

In this case I want the current kW load.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,093
This should work:

Code:
- platform: template
  sensors:
    energy_total:
      friendly_name: 'Total Energy'
      value_template: "{{ (states('sensor.pv1_power')|float + states('sensor.pv2_power')|float) }}"
      unit_of_measurement: "W"
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
44,670
This should work:

Code:
- platform: template
  sensors:
    energy_total:
      friendly_name: 'Total Energy'
      value_template: "{{ (states('sensor.pv1_power')|float + states('sensor.pv2_power')|float) }}"
      unit_of_measurement: "W"
Thanks I just about got the value_template part done when you posted this so you saved me some pain.
 

ne1gold

New Member
Joined
Mar 11, 2020
Messages
3
I hope someone with first hand experience can give me some direction please.

I have HA and a number of sonoff sensors running without cloud.

I would like to add outdoor PIR sensors and cameras.

What would you recommend?
Yale, EZVIZ, Philips Hue, Ajax?

I would like to keep this out of the cloud as far as possible.

Thank you
Securityeo.co.za are wholesale distributors and suppliers of full range ajax products. Security experts online go out of their way to assist and even willing to pre-program system for you. Give them a shout. very helpful and experienced
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
3,879
Recently installed one of these in the passage:

Got it into HA immediately through Ewelink and I assume the SonoffLAN integration. But yesterday the internet was off and the switch became unavailable until the internet came back and I restarted HA. Will check it again if the internet goes off but shouldn't this still be accessible without internet access?
 

SauRoNZA

Honorary Master
Joined
Jul 6, 2010
Messages
44,670
Can I put the Energy distribution card on any other Lovelace screen? Or can it really only run inside the Energy window?
 

riscbroker

Expert Member
Joined
Sep 29, 2006
Messages
2,237
Recently installed one of these in the passage:

Got it into HA immediately through Ewelink and I assume the SonoffLAN integration. But yesterday the internet was off and the switch became unavailable until the internet came back and I restarted HA. Will check it again if the internet goes off but shouldn't this still be accessible without internet access?
You could check here if the switch is supported for local access:

 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
3,879
You could check here if the switch is supported for local access:

Thanks, problem is this switch is a generic type and not a Sonoff.
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,155
Thanks, problem is this switch is a generic type and not a Sonoff.

On the list in the AlexxIT github under cloud only, there is one as King M4, that one seems very similar to yours. If we assume the firmwares are similar also, it could mean that dimmer is cloud only. Thats just a guess, I could be wrong.
 
Top