-
-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: | ||
 | ||
|
||
2. Edit it like this | ||
 | ||
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 | ||
|
||
 | ||
2. Edit the new switch | ||
3. Get the idx | ||
 | ||
|
||
4. Open event configuration : configuration -> devices -> Event | ||
 | ||
|
||
5. Add new python script | ||
 | ||
|
||
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.