> For the complete documentation index, see [llms.txt](https://docs.smart-stuff.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smart-stuff.nl/dsmr-api/koppelingen/domoticz-and-watersensor.md).

# Domoticz & Watersensor

1. Open een nieuwe gateway, ik heb hem “Smart Gateways Watermeter Gateway” genoemd
2. Selecteer HTTP/HTTPS poller
3. Method: GET
4. Content: application/json
5. URL: kies de locatie van de watermeter, bijvoorbeeld <http://192.168.2.220/api/v2/sm/info>
6. Kies de naam van de file voor de commando’s
7. Press add

<figure><img src="/files/0z7hKzAr8FmHgigp34Me" alt=""><figcaption></figcaption></figure>

8. Kies nu een virtual sensor type counter (click binnen het vak die je aangemaakt hebt) noem deze “Water”

<figure><img src="/files/BFG7X6aSZVi9j5EjKBy3" alt=""><figcaption></figcaption></figure>

9. Maak nu een file aan in \~/domoticz/scripts/Lua\_parser
10. touch “watermeter.lua”
11. nano watermeter.lua
12. 1. \-- Smart Gateways Watermeter Script
    2. s = request\['content'];
    3. local idWater = 1209 -- check de waarde van de aangemaakte virtuele sensor
    4. local a = domoticz\_applyJsonPath(s,".water.value")\*100 -- deel factor voor de sensor
    5. print('value read from poller: ' .. a) -- zorgt dat de waarde geprint wordt
    6. domoticz\_updateDevice(idWater,'',a)

<figure><img src="/files/d0jpsRtK6fhNHHtukzwz" alt=""><figcaption></figcaption></figure>

Afsluiten en je hebt een sensor in Domoticz die water aangeeft! Stell de waarde (deel factor enz)<br>
