sonoff

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
sonoff [10.03.2018 04:39] – [Falshing Tasmota Firmware] Pascal Sutersonoff [08.12.2018 09:57] – [Rules Engine - node-red] Pascal Suter
Line 45: Line 45:
   - download the sourcecode tar.gz or zip package from the [[https://github.com/arendst/Sonoff-Tasmota/releases|Tasmota releases page]]   - download the sourcecode tar.gz or zip package from the [[https://github.com/arendst/Sonoff-Tasmota/releases|Tasmota releases page]]
   - extract the contents of the ''lib'' directory into your arduino ide's ''portable/sketchbook/libraries'' directory and extract the entire ''sonoff'' directory into your arduin IDE's ''portable/sketchbook/'' directory   - extract the contents of the ''lib'' directory into your arduino ide's ''portable/sketchbook/libraries'' directory and extract the entire ''sonoff'' directory into your arduin IDE's ''portable/sketchbook/'' directory
-  - verify your settings under Tools are like these: <code> 
-Board: "Generic ESP8266 Module"  <<<<!!!! 
-Flash Mode: "DOUT"  <<<<!!!! 
-Flash Size: "1M (no SPIFFS)"  <<<<!!!! 
-Debug Port: "Disabled" 
-Debug Level: "None" 
-LwIP Variant: "v1.4 Prebuilt" <<<<!!! 
-Reset Method: "ck" 
-Crystal Frequency: "26 MHz" 
-Flash Frequency: "40MHz" 
-Upload Using: "Serial" 
-CPU Frequency: "80 MHz" 
-Upload Speed: "115200" 
-Port: Your COM port connected to sonoff 
-</code> 
   - edit ''user_config.h'' and enter your wifi name and password. all other settings can be changed later once the device is booted, but you can of course set them here if you want. this will make it much faster if you flash alot of these devices and want the same settings on all of them.    - edit ''user_config.h'' and enter your wifi name and password. all other settings can be changed later once the device is booted, but you can of course set them here if you want. this will make it much faster if you flash alot of these devices and want the same settings on all of them. 
   - **make sure your sonoff is disconnected from the AC power lines***   - **make sure your sonoff is disconnected from the AC power lines***
Line 145: Line 130:
 In order to turn the lights on in a room, you can publish to the topic ''set/dss/apartment/zones/Garden/groups/1/lastCalledScene'' and set the value to ''5'' or ''0''. here is an example using ''mosquitto_pub'':  In order to turn the lights on in a room, you can publish to the topic ''set/dss/apartment/zones/Garden/groups/1/lastCalledScene'' and set the value to ''5'' or ''0''. here is an example using ''mosquitto_pub'': 
   mosquitto_pub -h mqtt.psuter.ch -u sonoffs -P sonoff -t set/dss/apartment/zones/Garden/groups/1/lastCalledScene -m 5   mosquitto_pub -h mqtt.psuter.ch -u sonoffs -P sonoff -t set/dss/apartment/zones/Garden/groups/1/lastCalledScene -m 5
 +
  
 ===== Rules Engine - node-red ===== ===== Rules Engine - node-red =====
Line 174: Line 160:
 and here is what it looks like:  and here is what it looks like: 
 {{ :node-red:flow.png |}} {{ :node-red:flow.png |}}
 +==== a word about retention ====
 +it seems node-red sets the retention flag of mqtt by default. I learned this when i used it together with the mqtt-dss-connector: i created a rule that turned the light in the bathroom on. if i turned it off later (not via node-red) and then restarted the mqtt-dss-bridge the light in my bathroom went on again "for no reason" .. this was because that on command was published with the retention flag set to on (or actually not set to anything in node-red). so i set it to "false" and the problem was resolved. 
 +
 ===== Making the installation permanent ===== ===== Making the installation permanent =====
 this might be different in your setup, but I would like to install the npm modules globally and then run them as non-root users through a systemd script to make sure they are auto-startet as soon as my system boots. this might be different in your setup, but I would like to install the npm modules globally and then run them as non-root users through a systemd script to make sure they are auto-startet as soon as my system boots.
Line 200: Line 189:
 [Unit] [Unit]
 Description=Node.js MQTT DSS Bridge Description=Node.js MQTT DSS Bridge
-Requires=After=mosquitto.service       # Requires the mosquitto service to run first+Requires=mosquitto.service       # starts mosquitto first when this service is started manually 
 +After=mosquitto.service       # starts this after mosquitto on boot
  
 [Service] [Service]
Line 226: Line 216:
 [Unit] [Unit]
 Description=Node.js Node-RED Description=Node.js Node-RED
-Requires=After=node-red.service       # Requires the mosquitto service to run first+Requires=node-red.service       # starts node-red first when this service is started manually 
 +After=node-red.service       # starts this after node-red on boot
  
 [Service] [Service]
  • sonoff.txt
  • Last modified: 07.09.2021 05:52
  • by Pascal Suter