
What type of device do I need?
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
What type of device do I need?
My sensor (handmade) just output +3 volts (when the alarm) or 0 volts. What type of device is preferable to select in espeasy? Now I have done so, but it seems to me that it is not correct. This works, only when loading the sensor is triggered.


You do not have the required permissions to view the files attached to this post.
Andy.
-
- Core team member
- Posts: 9922
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: What type of device do I need?
My first idea would also be to use the switch input.
I don't really understand your problem here: "This works, only when loading the sensor is triggered."
With what controller do you like to interact? It looks like Domoticz, given you can set an IDX value.
I don't really understand your problem here: "This works, only when loading the sensor is triggered."
With what controller do you like to interact? It looks like Domoticz, given you can set an IDX value.
-
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
Re: What type of device do I need?
I assumed there was a dedicated plugin for this type of sensor.
Yes, I am using domoticz. When the ESP is restarted, for some reason, a sensor trigger signal occurs. This is not critical. I repeat: I just thought that there is another version of the type of device that suits me.
Yes, I am using domoticz. When the ESP is restarted, for some reason, a sensor trigger signal occurs. This is not critical. I repeat: I just thought that there is another version of the type of device that suits me.
Andy.
-
- Normal user
- Posts: 1385
- Joined: 17 Jun 2018, 20:41
- Location: USA
Re: What type of device do I need?
I suggest using a much longer debounce time.When the ESP is restarted, for some reason, a sensor trigger signal occurs.
- Thomas
-
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
-
- Normal user
- Posts: 4343
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: What type of device do I need?
You have checked 'Send Boot state', so that would be an explanation.Andrew Mamohin wrote: ↑25 Oct 2020, 17:02 When the ESP is restarted, for some reason, a sensor trigger signal occurs.
Are you using a recent version of ESPEasy (less than 2 months old) (assume so, just asking for confirmation)?
/Ton (PayPal.me)
-
- Normal user
- Posts: 4343
- Joined: 10 Jun 2018, 12:06
- Location: NL
Re: What type of device do I need?
Ah, you might want to select 'Switch Button Type = Push Button Active High', as that will give you the current state at the 'other end', not waiting for a state-change to switch state.
/Ton (PayPal.me)
-
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
Re: What type of device do I need?
No, any value of "Switch Button Type" (except "normal") causes incorrect functionality.
Perhaps I will make a sensor connection from the ESP to the optocoupler.
Andy.
-
- Normal user
- Posts: 124
- Joined: 05 May 2017, 23:45
- Location: Namur
Re: What type of device do I need?
Hi Andrew, can you describe what you're trying to achieve ? I'm curious.
-
- Core team member
- Posts: 9922
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: What type of device do I need?
I think "Send Boot state" is indeed one of the candidates to check.
For detecting a specific level, you indeed need to have the "normal switch" type, as it needs to evaluate the current state of the pin, not a toggle state.
One other reason for this behavior I can think of is that the ESP will call PLUGIN_READ at boot.
If the ESP experiences a power cycle, then the state has changed from "0" to "1", so it will for sure send out a message to the controller.
If this also happens at a warm boot (e.g. a crash), then I guess we may need to have a proper look at the implementation of the switch plugin as it would then not register a state change so no need to send data to the controller (assuming "Send Boot State" is unchecked)
For detecting a specific level, you indeed need to have the "normal switch" type, as it needs to evaluate the current state of the pin, not a toggle state.
One other reason for this behavior I can think of is that the ESP will call PLUGIN_READ at boot.
If the ESP experiences a power cycle, then the state has changed from "0" to "1", so it will for sure send out a message to the controller.
If this also happens at a warm boot (e.g. a crash), then I guess we may need to have a proper look at the implementation of the switch plugin as it would then not register a state change so no need to send data to the controller (assuming "Send Boot State" is unchecked)
-
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
Re: What type of device do I need?
I thought that perhaps there is a more suitable type of device for me in ESPEASY.
Now I want to prevent false switching on of my sensor in domoticz when rebooting the ESP.
Andy.
-
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
Re: What type of device do I need?
This happens even when the ESP is rebooted via the ESP EASY interface.
I came up with: I need to write rules so that this sensor is turned on only after loading. Or turn on transfer to domoticz 10 seconds after loading. Something like that.
Andy.
-
- Core team member
- Posts: 9922
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: What type of device do I need?
I just looked at the source code for the "Send Boot State" flag (which is checked in your screenshot)
This is what happens at boot (calling PLUGIN_INIT):
- GPIO state is read from the actual pin
- If "Send Boot State" flag is set, the state variable is inverted (see what happens in PLUGIN_TEN_PER_SECOND)
- state variable is stored in globalMapPortStatus
In the PLUGIN_TEN_PER_SECOND call, the stored state is compared with the actual pin state.
If this has changed, the new state is stored and the connected controller(s) will receive the new state.
So what this "Send Boot State" flag does, is it forces the first reading of the pin to send its state to the controller.
As already was suggested, try with "Send Boot State" flag unchecked.
To me it looks rather strange that doesn't apparently fix it?
This is what happens at boot (calling PLUGIN_INIT):
- GPIO state is read from the actual pin
- If "Send Boot State" flag is set, the state variable is inverted (see what happens in PLUGIN_TEN_PER_SECOND)
- state variable is stored in globalMapPortStatus
In the PLUGIN_TEN_PER_SECOND call, the stored state is compared with the actual pin state.
If this has changed, the new state is stored and the connected controller(s) will receive the new state.
So what this "Send Boot State" flag does, is it forces the first reading of the pin to send its state to the controller.
As already was suggested, try with "Send Boot State" flag unchecked.
To me it looks rather strange that doesn't apparently fix it?
-
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
Re: What type of device do I need?
Whoa! It works right! Thanks! It's weird that I haven't tried this before. I'm a little dumb...
Andy.
-
- Core team member
- Posts: 9922
- Joined: 01 Sep 2017, 22:13
- Location: the Netherlands
Re: What type of device do I need?
Good to know I don't need to look further in that part of the code 

Who is online
Users browsing this forum: Anthropic Claude Bot [bot], Perplexity.ai [bot] and 22 guests