the current situation:
*i have a poolhouse with 8 electric cirquits (lightning and pool things). those connections are hard-wired with 24V buttons, connected to a pulse relay (teleruptor) who toggles on and off the 230V (one pulse on, next pulse off)
I now want to integrate this poolhouse into my existing hassio with the following conditions:
*the āanalogā system (wired buttons and teleruptors) need to stay. I want to be independent in case of IT problems
*nevertheless, 90% of all the interactions will happen on the hassio and no longer on the buttons (see them as a fail-save)
*changing the wall-switch is also hard, because itās nicely integrated.
I used already a tasmotised nodemcu (with a pulse timer of 50msec) and connected it in parallel with the existing wired system (on the inputs of the pulse relay). This works fine, butā¦obvious the light icon on my hassio console lights op for 50 msec and goes to off again (mqtt based). this is visually annoying.
now iām looking for two possible solutions:
*is there a simple (and cheap) way to āknowā of measureā the state of the electric cirquit (hassio has no idea of the wired button is pushed or not)
*if not, is there a way i can visually ācheatā the lamp icon on hassio? meaning: one pulse it goes on, the next pulse it goes of and so on?
As you have already played with some ESP stuff, you could consider putting a custom module on each 24V line.
You would need to monitor the 24V line for people pushing the button. Use a state machine to track the state. Tasmota, ESPurna, ESPEasy should, maybe with some modification or configuration allow this.
They would then maintain state machine and send HASS the current state on the correct state topic.
When HASS sends a state command the ESP devices then need to send the 24V pulse.
Remember of course that ESP devices are 3.3V and while they may tolerate 5V briefly, if you hit them with a full 24V pulse, while it may appear to work, the ESP will fry eventually. So you will need a voltage divider on the sense side, probably a 6:1 ratio. And either a 24V supply and mosfet or a boost converter on the sending side.
On your question on āknowingā the state of the mains lines, there are plenty of sensors out there which you can add to the ESP which will give you a nice clean, safe 3.3V digital signal if the live line is energised. Some of them do not even need to tap the wire. Google for āContactless mains sensor Arduinoā or similar. Without such a sensor you would risk the state HASS or ESP* has getting out of sync with reality. Something like this: https://www.instructables.com/id/Contactless-AC-Detector/
I have more or less a similar setup. I use sonoff ch4 pro to generate the pulses, and sonoff basics in parallel with the lights to see if they are on or off (in combination with template lights)
hi, thanks for the response. i was also thinking that way, but the 3,3V is really a pain in the ***
this means, one way or another i need ANOTHER parallel cirquit on 5V of 3,3V to āmeasureā the power.
stupid question, if decide to use the wired buttons as ābackupā, can i cheat on my hassio interface to let the icon toggle on and of, indepenent of the real relay status?
hi, thanks for your response.
i donāt get the function of the sonoff basic. if you put in in parallel with the lights, how do you mean that?
can the sonoff basic āfeelā that there is power in itās input? (i assume itās also flashed?)
Most of the boards will take 5V input for power, but they regulate it to 3.3V. The chip itself will usually handle 5V on itās pins, lots of people report sending it 5V and it works, but I donāt believe it makes any claims to be 5V tolerant.
If I understand correctly, you are reading a 24V line pulse. All you need to something like a 10K resistor and a 60K resistor to divide 24V down to 4V which is probably close enough. Google āVoltage dividerā Actually 10K and 100K will get you close to 2V and thatās enough for a logic HIGH on the ESP.
I believe what @francisp means is when the mains power is ON the SOnOff will be powered up, when the mains power is off the SOnOff will be powered off. You could then use it as a main power sensor. Quite an interesting hack.
both of you guys are wonderful. using a sonoff basic sounds like a foolproof and cheap way of monitoring (honestly i prefer it over a 5.5 cirquit, but the way of working stays the same).
4 dollars a piece ā¦sounds like a good deal.
I will order some to do my testing. iāll keep this thread updated.
a big thank you at Paul and at Francis (who is als speaking sutch according his snippits code )
An idea is to use for latching relays a model like GEYA GRM8-02 ( see https://fr.aliexpress.com/item/32977619750.html ,look a the 4th photo) : if you shortcut the B1/B2 connexion, you have 2 outputs circuits . One can command your light/pump, the other one can provide a feedback to Hassio to know the state of the relay.
I just did a test with a ch4 and a sonoff powr216a (did not have a basic) and everything is working but when turning of the light it takes a while until ha is noticing the basic is offline to switch the status of the icon. I was wondering if in the example of francisp the script script.scriptlichtslaapkamervooraanaf contains some magic to overcome this issue?
Francis,
What about Eltako dimmers? Ok for the Sonoff Basic to capture the state of the light on or off, but how to find out the intensity of the light? And then changing the intensity via HA. Relay modules for dimmers arenāt easy to find.
Would like to keep current 24V Niko pulse switches working independent from HA.
I also have eltaco dimmers 24v, but use HA only for on off. Dimmers are not realy used in the last 10 years. Except if sombody else pressed to long on the button so I can set the light back to 100%. Would like to find some smart eltaco 24v sort of switches to replace de sonoff setup described above and eltaco with 1 device that works with my analoog Niko buttons and HA.