diff --git a/README.md b/README.md index ac82221..645f9c4 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ We will retrieve these informations: You can add an api key for https://home.openweathermap.org/ in your config file. In the future version of the dashboard you will be able to see your consumption vs exterior temperature. ## Connect your home automation system: -- Domoticz (soon) +- [Domoticz](docs/domoticz/Domoticz.md) - [HomeAssistant](https://github.com/Flodu31/HomeAssistant-PeugeotIntegration) - Jeedom (Anyone can share the procedure ?) diff --git a/docs/domoticz/Domoticz.md b/docs/domoticz/Domoticz.md new file mode 100644 index 0000000..da5efd0 --- /dev/null +++ b/docs/domoticz/Domoticz.md @@ -0,0 +1,50 @@ +## Connect Domoticz +### I. Add stop hour control +In this example we will add the possibility to stop the charge at 6 o'clock. +1. Add new selector switch: +![selector](selector.png) + +2. Edit it like this +![edit selector](edit_selector.png) +Selector action: + - http://localhost:5000/dash/charge_control?vin=YOURVIN&hour=0&minute=0 + - http://localhost:5000/dash/charge_control?vin=YOURVIN&hour=6&minute=0 + +3. Save +# II. Add charge threshold control +You can do the same thing that we did in part one. You just have to change url to : +- http://localhost:5000/charge_control?vin=YOURVIN&percentage=100 +- http://localhost:5000/charge_control?vin=YOURVIN&percentage=XX + +If you want more precise control : +1. Add a virtual switch + +![add sensor](add_sensor.png) +2. Edit the new switch +3. Get the idx +![get idx](idx.png) + +4. Open event configuration : configuration -> devices -> Event +![event](event.png) + +5. Add new python script +![add_python_script](add_python_script.png) + +6. Add this code and change the vin in the url +```python +import domoticz +import DomoticzEvents as DE +import urllib.request + + + +for name, value in DE.user_variables.items(): + domoticz.log("var"+ str(name)+ "has value"+ str(value)) + + +domoticz.log("The device that got changed is: "+DE.changed_device_name) +# changed_device.name is the same string +if DE.changed_device_name== "Seuil de charge": + urllib.request.urlopen('http://localhost:5000/charge_control?vin=YOURVIN&percentage='+str(DE.changed_device.s_value)) +``` +7. Save diff --git a/docs/domoticz/add_python_script.png b/docs/domoticz/add_python_script.png new file mode 100644 index 0000000..adead38 Binary files /dev/null and b/docs/domoticz/add_python_script.png differ diff --git a/docs/domoticz/add_sensor.png b/docs/domoticz/add_sensor.png new file mode 100644 index 0000000..8c0db64 Binary files /dev/null and b/docs/domoticz/add_sensor.png differ diff --git a/docs/domoticz/edit_selector.png b/docs/domoticz/edit_selector.png new file mode 100644 index 0000000..2f48988 Binary files /dev/null and b/docs/domoticz/edit_selector.png differ diff --git a/docs/domoticz/event.png b/docs/domoticz/event.png new file mode 100644 index 0000000..d608fa8 Binary files /dev/null and b/docs/domoticz/event.png differ diff --git a/docs/domoticz/idx.png b/docs/domoticz/idx.png new file mode 100644 index 0000000..54527d8 Binary files /dev/null and b/docs/domoticz/idx.png differ diff --git a/docs/domoticz/selector.png b/docs/domoticz/selector.png new file mode 100644 index 0000000..f5c1dbb Binary files /dev/null and b/docs/domoticz/selector.png differ