Status of the switch when the power is turned off

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
BuddhaZen
Normal user
Posts: 13
Joined: 07 Apr 2018, 14:23

Status of the switch when the power is turned off

#1 Post by BuddhaZen » 07 Apr 2018, 14:37

Hi, ESP firmware - mega-20180407. I created a SWITCH, the option - Send Boot state - activated. If the power supply ESP is missing, Domoticz does not determine the status of the switch. When the power ESP is turned on, the SWITCH will be turned off, and Domotics can show the old information that the SWITCH is ON. How to fix it?

hans65
Normal user
Posts: 38
Joined: 19 Mar 2018, 17:01

Re: Status of the switch when the power is turned off

#2 Post by hans65 » 08 Apr 2018, 08:17

Have you tried with a dummy variable?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Status of the switch when the power is turned off

#3 Post by toffel969 » 08 Apr 2018, 12:19

BuddhaZen wrote: 07 Apr 2018, 14:37 Hi, ESP firmware - mega-20180407. I created a SWITCH, the option - Send Boot state - activated. If the power supply ESP is missing, Domoticz does not determine the status of the switch. When the power ESP is turned on, the SWITCH will be turned off, and Domotics can show the old information that the SWITCH is ON. How to fix it?
Which gpio are you using? Gpio 0,2,15 have fixed boot states that could be a src of error.

Alternatively you could add a rule to send device state manually after boot.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

vbs
New user
Posts: 2
Joined: 08 Apr 2018, 12:40

Re: Status of the switch when the power is turned off

#4 Post by vbs » 08 Apr 2018, 12:59

toffel969 wrote: 08 Apr 2018, 12:19 Alternatively you could add a rule to send device state manually after boot.
Sorry, newbie here. How could I do this?

I am using an "FHEM HTTP" Controller and would also like try sending boot state manually. In the documentation (https://www.letscontrolit.com/wiki/inde ... _Reference) I have only found the commands "Publish" and the "Send*"-Commands but they seem either MQTT-only or to other ESPs or raw HTTP requests.
Any other way to force sending of the current value to the configured controller?

I have also tried something like this:

Code: Select all

on System#Boot do
     TaskValueSet 1,1,0
     TaskRun 1
endon
Thank you

BuddhaZen
Normal user
Posts: 13
Joined: 07 Apr 2018, 14:23

Re: Status of the switch when the power is turned off

#5 Post by BuddhaZen » 09 Apr 2018, 09:28

toffel969 wrote: 08 Apr 2018, 12:19 Which gpio are you using? Gpio 0,2,15 have fixed boot states that could be a src of error.
Alternatively you could add a rule to send device state manually after boot.
I use GPIO 4. How to create a rule?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Status of the switch when the power is turned off

#6 Post by toffel969 » 09 Apr 2018, 13:13

BuddhaZen wrote: 09 Apr 2018, 09:28
toffel969 wrote: 08 Apr 2018, 12:19 Which gpio are you using? Gpio 0,2,15 have fixed boot states that could be a src of error.
Alternatively you could add a rule to send device state manually after boot.
I use GPIO 4. How to create a rule?
Hi, if using GPIO4, make sure that I2C is deactivated in the hardware tab. I would try that first before going with the rule.

The rules (first need to be activated under advanced tab):

Code: Select all

On system#boot do 
timerset,1,10
Endon

On Rules#Timer=1 do 
TaksRun,1 //(assuming the input switch device is on Task 1)
Endon
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

BuddhaZen
Normal user
Posts: 13
Joined: 07 Apr 2018, 14:23

Re: Status of the switch when the power is turned off

#7 Post by BuddhaZen » 09 Apr 2018, 13:35

toffel969 wrote: 09 Apr 2018, 13:13 Hi, if using GPIO4, make sure that I2C is deactivated in the hardware tab.
Yep, I2C of course disabled )) Thank you, I will continue to understand this issue further.

UPD:
Solved the problem in this way:

Code: Select all

On system#boot do 
timerset,1,10
Endon

On Rules#Timer=1 do 
SendToHTTP [domoticz IP],8080,/json.htm?type=command&param=switchlight&idx=3&switchcmd=Off
Endon
The timer is triggered and sends a trip command. By default GIPO4 I pull down to GND.
It's bad that there is no memorization of the current state Switch :(

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 10 guests