arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.18k stars 4.8k forks source link

Shelly 1PM is not following switch input in SwitchMode 1 #20636

Closed nefh closed 8 months ago

nefh commented 9 months ago

PROBLEM DESCRIPTION

A clear and concise description of what the problem is.

Hi! I have Shelly 1PM flashed with current tasmota and I am trying to use it as middleman between thermostat controller and valve actuator. Thermostat operates on 230v - it either closes or opens the circuit to control valve. I want to simply passthrough the state from thermostat controller to actuator, therefore I am using SwitchMode 1. However, the power output seams to not following the switch. Below input from console:

07:40:54.531 CMD: Switchmode
07:40:54.537 MQT: tasmota/stat/CieploShelly1PM/RESULT = {"SwitchMode1":1}
07:40:58.293 CMD: State
07:40:58.301 MQT: tasmota/stat/CieploShelly1PM/RESULT = {"Time":"2024-02-01T07:40:58","Uptime":"0T00:21:22","UptimeSec":1282,"Heap":23,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"Miura","BSSId":"F0:79:59:D1:54:C0","Channel":11,"Mode":"11n","RSSI":24,"Signal":-88,"LinkCount":1,"Downtime":"0T00:00:03"}}
07:41:03.266 CMD: Status 10
07:41:03.276 MQT: tasmota/stat/CieploShelly1PM/STATUS10 = {"StatusSNS":{"Time":"2024-02-01T07:41:03","Switch1":"OFF","ANALOG":{"Temperature":44.5},"ENERGY":{"TotalStartTime":"2024-01-03T06:51:48","Total":0.557,"Yesterday":0.015,"Today":0.015,"Power":2},"TempUnit":"C"}}

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

09:53:33.522 MQT: tasmota/stat/CieploShelly1PM/RESULT = {"NAME":"Shelly 1PM","GPIO":[320,0,0,0,192,2720,0,0,0,0,0,224,0,4736],"FLAG":0,"BASE":18} 09:53:33.750 MQT: tasmota/stat/CieploShelly1PM/RESULT = {"Module":{"0":"Shelly 1PM"}} 09:53:34.000 MQT: tasmota/stat/CieploShelly1PM/RESULT = {"GPIO0":{"320":"Led_i1"},"GPIO1":{"0":"None"},"GPIO2":{"0":"None"},"GPIO3":{"0":"None"},"GPIO4":{"192":"Switch_n1"},"GPIO5":{"2720":"BL0937 CF"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"0":"None"},"GPIO13":{"0":"None"},"GPIO14":{"0":"None"},"GPIO15":{"224":"Relay1"},"GPIO16":{"0":"None"},"GPIO17":{"4736":"ADC Temp"}}

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
Rules not being used.

10:01:02.833 MQT: tasmota/stat/CieploShelly1PM/STATUS = {"Status":{"Module":0,"DeviceName":"CieploShelly1PM","FriendlyName":["CieploShelly1PM"],"Topic":"CieploShelly1PM","ButtonTopic":"0","Power":1,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}} 10:01:02.838 MQT: tasmota/stat/CieploShelly1PM/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Software/System restart","Uptime":"0T02:41:26","StartupUTC":"2024-02-01T06:19:36","Sleep":50,"CfgHolder":4617,"BootCount":28,"BCResetTime":"2024-01-03T06:48:32","SaveCount":390,"SaveAddress":"F6000"}} 10:01:02.843 MQT: tasmota/stat/CieploShelly1PM/STATUS2 = {"StatusFWR":{"Version":"13.3.0(tasmota)","BuildDateTime":"2023-12-12T14:29:05","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"424/699"}} 10:01:02.847 MQT: tasmota/stat/CieploShelly1PM/STATUS3 = {"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["Miura",""],"TelePeriod":300,"Resolution":"558180C0","SetOption":["00008009","2805C80001000600003C5A0A192800000000","00000080","00006000","00004000","00000000"]}} 10:01:02.860 MQT: tasmota/stat/CieploShelly1PM/STATUS4 = {"StatusMEM":{"ProgramSize":637,"Free":364,"Heap":20,"ProgramFlashSize":1024,"FlashSize":2048,"FlashChipId":"15400B","FlashFrequency":40,"FlashMode":"DOUT","Features":["0809","8F9AC787","04368001","000000CF","010013C0","C000F981","00004004","00001000","54000020","00000080","00000000"],"Drivers":"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45,62,68","Sensors":"1,2,3,4,5,6","I2CDriver":"7"}} 10:01:02.868 MQT: tasmota/stat/CieploShelly1PM/STATUS5 = {"StatusNET":{"Hostname":"CieploShelly1PM","IPAddress":"172.16.2.70","Gateway":"172.16.2.1","Subnetmask":"255.255.255.0","DNSServer1":"172.16.2.10","DNSServer2":"0.0.0.0","Mac":"34:94:54:75:C4:52","Webserver":2,"HTTP_API":1,"WifiConfig":4,"WifiPower":17.0}} 10:01:02.873 MQT: tasmota/stat/CieploShelly1PM/STATUS6 = {"StatusMQT":{"MqttHost":"172.16.2.111","MqttPort":1883,"MqttClientMask":"CieploShelly1PM","MqttClient":"CieploShelly1PM","MqttUser":"mosquitto","MqttCount":2,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}} 10:01:02.879 MQT: tasmota/stat/CieploShelly1PM/STATUS7 = {"StatusTIM":{"UTC":"2024-02-01T09:01:02","Local":"2024-02-01T10:01:02","StartDST":"2024-03-31T02:00:00","EndDST":"2024-10-27T03:00:00","Timezone":"+01:00","Sunrise":"08:20","Sunset":"17:46"}} 10:01:02.884 MQT: tasmota/stat/CieploShelly1PM/STATUS9 = {"StatusPTH":{"PowerDelta":[0,0,0],"PowerLow":0,"PowerHigh":0,"VoltageLow":0,"VoltageHigh":0,"CurrentLow":0,"CurrentHigh":0}} 10:01:02.895 MQT: tasmota/stat/CieploShelly1PM/STATUS10 = {"StatusSNS":{"Time":"2024-02-01T10:01:02","Switch1":"OFF","ANALOG":{"Temperature":37.9},"ENERGY":{"TotalStartTime":"2024-01-03T06:51:48","Total":0.557,"Yesterday":0.015,"Today":0.015,"Power":3},"TempUnit":"C"}} 10:01:02.902 MQT: tasmota/stat/CieploShelly1PM/STATUS11 = {"StatusSTS":{"Time":"2024-02-01T10:01:02","Uptime":"0T02:41:26","UptimeSec":9686,"Heap":20,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":2,"POWER":"ON","Wifi":{"AP":1,"SSId":"Miura","BSSId":"00:C1:64:B3:CB:A0","Channel":1,"Mode":"11n","RSSI":56,"Signal":-72,"LinkCount":1,"Downtime":"0T00:00:03"}}}

- [ ] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
  Console output here:
I will post as soon as thersmostat change its output to shelly.

TO REPRODUCE

Steps to reproduce the behavior:

  1. Flash Shelly 1PM via OTA as in official guideline.
  2. Set SwitchMode 1

EXPECTED BEHAVIOUR

A clear and concise description of what you expected to happen. Power output should follow switch input.

SCREENSHOTS

If applicable, add screenshots to help explain your problem.

ADDITIONAL CONTEXT

Add any other context about the problem here.

(Please, remember to close the issue when the problem has been addressed)

sfromis commented 9 months ago

What you post looks like Tasmtoa working correctly as designed. The thing is that ON/OFF for a Switch input is unrelated to what you think of as the physical switch being on or off. The Switch input reports as "ON" when the signal is high and "OFF" when it is low. And the usual way such an input works is that it connects the gpio to ground (OFF) when enganged, and when not the internal pullup means that it gets to be high (ON). Hence the Switch input being "ON" means that a relay should be off when following state and vice versa.

However, (assuming that your Shelly 1PM acts in a similar way as Shelly Plus 1PM), this normal scheme is not how the hardware works, which instead is the opposite, high/OFF when you have power to the SW terminal, and low/ON when not. Hence you should most probably see it working as you expect by using the inverted SwitchMode 2 instead of mode 1.

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 8 months ago

This issue was automatically closed because of being stale. Feel free to open a new one if you still experience this problem.