I needed some really simple gateway to toggle cheap 433mhz power plugs (in germay mostly manufactured by Intertechno) from pimatic. I have no need to read anything back or be fancy. I needed something simple. I made something simple.
See instructables.com or for a good german tutoral alexbloggt.com.
- Change
ssid
andpassword
according your needs - Install libraries if needed
ESP8266WiFi
ESP8266WebServer
ESP8266mDNS
rc-switch
- Double check your
DATA_PIN
, for me it isD2
- Upload via Arduino.cc
Simply curl the api with the correct housecode and socketcode. I made usage of binary codes, as i can just read the dips without thinking.
curl -s "http://ESP-433-Gateway/changestate?housecode=<housecode>&socketcode=<socketcode>&state=<state>"
e.g.:
curl -s "http://ESP-433-Gateway/changestate?housecode=10001&socketcode=00100&state=on"
Pimatic device config could look like this:
{
"onCommand": "curl -s \"http://ESP-433-Gateway/changestate?housecode=10001&socketcode=00100&state=on\"",
"offCommand": "curl -s \"http://ESP-433-Gateway/changestate?housecode=10001&socketcode=00100&state=off\"",
"echo": {
"additionalNames": []
},
"id": "fusion_reactor",
"name": "fusion reactor",
"class": "ShellSwitch"
},
Home Assistant device config could look like this:
switch:
- platform: command_line
switches:
tv_rack:
command_on: "/usr/bin/curl -X GET 'http://192.168.1.94/changestate?housecode=10001&socketcode=10000&state=on'"
command_off: "/usr/bin/curl -X GET 'http://192.168.1.94/changestate?housecode=10001&socketcode=10000&state=off'"
friendly_name: TV Rack
This is mostly inspired by alexbloggt.com - thanks for your work!
Also thanks to techtutorialsx.com for the explanation of arg usage!