Closed voicevon closed 6 years ago
Unfortunately, you'll need to give me more information to help you. Can you show your pump_A
configuration? - is it a GPIO switch? Does it have a name
?
And what do you mean by "The pump_A switch has no response."? Is it only not showing up in hass or is it not working at all?
Also, just to be sure, can you try with https://beta.esphomelib.com/esphomeyaml/guides/faq.html#how-do-i-update-to-the-latest-beta-release
Yes, pump_A
is a GPIO switch, it's the name and Id, same string. where leaking
and ld
is GPIO binary sensor.
I expect pump_A will be turned on when template_switch is turned on(depend on the sensors).
The result is when I pressed any of the two buttons. Mqtt monitor showed template_switch's state correctly, this proved template lambda works fine.
lambda: >-
if (id(leaking).value || id(lp).value) {
return true;
} else {
return false;
}
but the pump_A
has no response,and I can't find any message from MQTT monitor about pumb_A
. this proved automation didn't work fine.
turn_on_action:
- switch.turn_on:
id: pump_A
turn_off_action:
- switch.turn_off:
id: pump_A
optimistic: true
I'am happy to see Version 1.9.0 includes a new feature of Script
, So I can write a script to turn on/ turn off pumb_A
in gpio binary sensors. Meanwhile, I can remove my template_switch. I will try soon.
Once again, without a minimal working example I can't help you very much. I just tried to make such a template switch myself using the information you gave me, but that works correctly. So please give me a YAML file with which I can reproduce this, otherwise I don't know how I can help you here.
I reinstalled everything with the newest version. Those are Hassio, Esphomeyaml, Esphomelib, The problem has gone.Now it works well. And, I am happy the script
feature is very good for "share" repeated codes.
Ok, good, closing this issue
Environment: EsphomeLib V1.8.2 && V1.9.0.? (Nov 14 2018) EsphomeYaml V1.82 I reference this page https://esphomelib.com/esphomeyaml/components/switch/template.html, Yaml source code is:
Esphomeyaml created C++ code is: (I modified label names to read it better)
Result: 1) The sensor works well. Can see sensor state from mqtt. 2) The template_switch lamda works well, from mqtt ,Can see this switch turn_on, turn_off 3) The pump_A switch has no response. No mqtt message related to pump_A. No debug information related to pump_A.