Created
February 23, 2023 16:29
-
-
Save velaar/4e18a200c1db7b06109a3fd840838684 to your computer and use it in GitHub Desktop.
Delta VoiceIQ API for homeassistant
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
Delta VoiceIQ API for homeassistant via Rest integration | |
Requirements: | |
2 Secrets: | |
Both can be retrieved from https://device.legacy.deltafaucet.com/#/home | |
* delta_device_id - click on usage - it will be in the URL https://device.legacy.deltafaucet.com/#/device/usage/<your_device_id_here> | |
delta_device_id: <your device id> | |
* delta_token | |
Go to inspector (Ctrl + Shift + I) -> Console; | |
Type window.localStorage.auth_token a long string will come up. delta_token should be compiled as follows: | |
delta_token: Bearer <the string from above without quoted> | |
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
input_text: | |
delta_device_id: | |
name: delta_device_id | |
initial: !secret delta_device_id | |
rest_command: | |
delta_dispense_mills: | |
method: POST | |
url: > | |
https://device.legacy.deltafaucet.com/api/device/dispense?deviceId={{states.input_text.delta_device_id.state}}&milliliters={{mililiters}} | |
headers: | |
Authorization: !secret delta_token | |
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 | |
Referer: https://device.legacy.deltafaucet.com/ | |
delta_toggle: | |
method: POST | |
url: > | |
https://device.legacy.deltafaucet.com/api/device/toggleWater?deviceId={{states.input_text.delta_device_id.state}} | |
headers: | |
Authorization: !secret delta_token | |
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 | |
Referer: https://device.legacy.deltafaucet.com/ | |
sensor: | |
- platform: rest | |
scan_interval: 600 | |
name: delta_faucet_consumption_today | |
unique_id: delta_faucet_consumption_today | |
resource: https://device.legacy.deltafaucet.com/api/device/UsageReport | |
method: GET | |
params: | |
interval: 0 | |
deviceId: !secret delta_device_id | |
headers: | |
Authorization: !secret delta_token | |
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 | |
Referer: https://device.legacy.deltafaucet.com/ | |
value_template: "{{ value_json.retObject.datasets[0].data[-1] | float * 3.78541 | round()}}" | |
json_attributes_path: "$.retObject" | |
json_attributes: | |
- datasets | |
- labels | |
unit_of_measurement: "L" | |
device_class: water | |
state_class: total_increasing | |
icon: mdi:water-pump | |
- platform: rest | |
scan_interval: 18000 | |
name: delta_faucet_consumption_this_month | |
unique_id: delta_faucet_consumption_this_month | |
resource: https://device.legacy.deltafaucet.com/api/device/UsageReport | |
method: GET | |
params: | |
interval: 2 | |
deviceId: !secret delta_device_id | |
headers: | |
Authorization: !secret delta_token | |
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36 | |
Referer: https://device.legacy.deltafaucet.com/ | |
value_template: "{{ value_json.retObject.datasets[0].data[-1] | float * 3.78541 | round()}}" | |
json_attributes_path: "$.retObject" | |
json_attributes: | |
- datasets | |
- labels | |
unit_of_measurement: "L" | |
device_class: water | |
state_class: total_increasing | |
icon: mdi:water-pump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hey I read your notes on reddit and I am wondering if you ever poked into what the port is that is connecting the device here to the solenoid. It says ethernet in the docs, and it looks like ethernet. But more likely just rj-45 style plug. I have been wondering though if it is or is not...or what it is. Because If you dont really care about all the measurements stuff, it seem like you could trigger the solenoid some other way and even if you did want the measurements you hinted about a lot more "stuff" workable over local https calls. Do you have anymore info on the hardware side that might have more detailed hacking?