
What type of device do I need?
Moderators: grovkillen, Stuntteam, TD-er
- Andrew Mamohin
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
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.


- Attachments
-
- JxJF0nqFuK.jpg (46.94 KiB) Viewed 14998 times
Andy.
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.
- Andrew Mamohin
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
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.
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
- Andrew Mamohin
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
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)
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)
- Andrew Mamohin
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
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.
Re: What type of device do I need?
Hi Andrew, can you describe what you're trying to achieve ? I'm curious.
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)
- Andrew Mamohin
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
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.
- Andrew Mamohin
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
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.
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?
- Andrew Mamohin
- Normal user
- Posts: 102
- Joined: 12 Jun 2020, 08:30
- Location: Belarus, Gomel
- Contact:
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.
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: Ahrefs [Bot] and 16 guests