From 83c774bf353c40e7c24a906c050324d082ecf842 Mon Sep 17 00:00:00 2001 From: Holger Eisold Date: Thu, 16 Jan 2025 21:09:07 +0100 Subject: [PATCH] [surepetcare] added waterstation Felaqua * Fixes: #15654 * added Felaqua pet waterstation * added UoM where possible * other small fixes Signed-off-by: Holger Eisold --- .../org.openhab.binding.surepetcare/README.md | 508 +++++++++++++----- .../internal/SurePetcareConstants.java | 9 +- .../internal/SurePetcareHandlerFactory.java | 2 + .../SurePetcareDiscoveryService.java | 3 + .../internal/dto/SurePetcareDevice.java | 3 +- .../internal/dto/SurePetcarePetDrinking.java | 36 ++ .../internal/dto/SurePetcarePetStatus.java | 1 + .../handler/SurePetcareDeviceHandler.java | 16 +- .../handler/SurePetcarePetHandler.java | 13 + .../src/main/resources/OH-INF/addon/addon.xml | 2 +- .../OH-INF/i18n/surepetcare.properties | 17 +- .../OH-INF/i18n/surepetcare_de.properties | 19 +- .../main/resources/OH-INF/thing/things.xml | 61 ++- .../main/resources/OH-INF/update/update.xml | 11 + .../internal/data/SurePetcareDeviceTest.java | 22 + 15 files changed, 562 insertions(+), 161 deletions(-) create mode 100644 bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetDrinking.java diff --git a/bundles/org.openhab.binding.surepetcare/README.md b/bundles/org.openhab.binding.surepetcare/README.md index 7667b5f233bb3..a634e1d534516 100644 --- a/bundles/org.openhab.binding.surepetcare/README.md +++ b/bundles/org.openhab.binding.surepetcare/README.md @@ -1,10 +1,10 @@ # Sure Petcare Binding -This binding offers integration to the Sure Petcare API, supporting cloud-connected cat flaps and feeders. +This binding offers integration to the Sure Petcare API, supporting cloud-connected pet/cat flaps, feeders and waterstations. ## Features -1. Read access to all attributes for households, devices (hubs, flaps) and pets through individual things/channels. +1. Read access to all attributes for households, devices (hubs, flaps, feeder, waterstations) and pets through individual things/channels. 1. Manual setting of pet location. 1. Setting of LED Mode (hub), Locking Mode (flaps) and Curfews. @@ -25,14 +25,15 @@ The binding code is based on a lot of work done by other developers: This binding supports the following thing types -| Thing | Thing Type | Discovery | Description | -|-----------------|------------|-----------|--------------------------------------------------------------------------| -| Bridge | Bridge | Manual | A single connection to the Sure Petcare API | -| Household | Thing | Automatic | The Sure Petcare Household | -| Hub Device | Thing | Automatic | The hub device which connects the cat flaps and feeders to the internet | -| Flap Device | Thing | Automatic | A cat or pet flap | -| Feeder Device | Thing | Automatic | A pet feeder | -| Pet | Thing | Automatic | A pet (dog or cat) | +| Thing | Thing Type | Discovery | Description | +|-----------------------|------------|-----------|--------------------------------------------------------------------------| +| Bridge | Bridge | Manual | A single connection to the Sure Petcare API | +| Household | Thing | Automatic | The Sure Petcare Household | +| Hub Device | Thing | Automatic | The hub device which connects the cat flaps and feeders to the internet | +| Flap Device | Thing | Automatic | A cat or pet flap | +| Feeder Device | Thing | Automatic | A pet feeder | +| Waterstation Device | Thing | Automatic | A pet drinking station | +| Pet | Thing | Automatic | A pet (dog or cat) | ## Getting started / Discovery @@ -75,77 +76,94 @@ Channel names in **bold** are read/write, everything else is read-only ### Flap Device Thing (Cat or Pet Flap) -| Channel | Type | Description | -|--------------------|--------------|------------------------------------------------------------| -| id | Number | A unique id assigned by the Sure Petcare API | -| name | Text | The name of the flap | -| product | Text | The type of product (3=pet flap, 6=cat flap) | -| curfewEnabled1 | Switch | Indicator if curfew #1 configuration is enabled | -| curfewLockTime1 | Text | The curfew #1 locking time (HH:MM) | -| curfewUnlockTime1 | Text | The curfew #1 unlocking time (HH:MM) | -| curfewEnabled2 | Switch | Indicator if curfew #2 configuration is enabled | -| curfewLockTime2 | Text | The curfew #2 locking time (HH:MM) | -| curfewUnlockTime2 | Text | The curfew #2 unlocking time (HH:MM) | -| curfewEnabled3 | Switch | Indicator if curfew #3 configuration is enabled | -| curfewLockTime3 | Text | The curfew #3 locking time (HH:MM) | -| curfewUnlockTime3 | Text | The curfew #3 unlocking time (HH:MM) | -| curfewEnabled4 | Switch | Indicator if curfew #4 configuration is enabled | -| curfewLockTime4 | Text | The curfew #4 locking time (HH:MM) | -| curfewUnlockTime4 | Text | The curfew #4 unlocking time (HH:MM) | -| lockingMode | Text | The locking mode (e.g. in/out, in-only, out-only etc.) | -| online | Switch | Indicator if the flap is connected to the hub | -| lowBattery | Switch | Indicator if the battery voltage is low | -| batteryLevel | Number | The battery voltage percentage | -| batteryVoltage | Number | The absolute battery voltage measurement | -| deviceRSSI | Number:Power | The received device signal strength in dB | -| hubRSSI | Number:Power | The received hub signal strength in dB | +| Channel | Type | Description | +|--------------------|--------------------------|------------------------------------------------------------| +| id | Number | A unique id assigned by the Sure Petcare API | +| name | Text | The name of the flap | +| product | Text | The type of product (3=pet flap, 6=cat flap) | +| curfewEnabled1 | Switch | Indicator if curfew #1 configuration is enabled | +| curfewLockTime1 | Text | The curfew #1 locking time (HH:MM) | +| curfewUnlockTime1 | Text | The curfew #1 unlocking time (HH:MM) | +| curfewEnabled2 | Switch | Indicator if curfew #2 configuration is enabled | +| curfewLockTime2 | Text | The curfew #2 locking time (HH:MM) | +| curfewUnlockTime2 | Text | The curfew #2 unlocking time (HH:MM) | +| curfewEnabled3 | Switch | Indicator if curfew #3 configuration is enabled | +| curfewLockTime3 | Text | The curfew #3 locking time (HH:MM) | +| curfewUnlockTime3 | Text | The curfew #3 unlocking time (HH:MM) | +| curfewEnabled4 | Switch | Indicator if curfew #4 configuration is enabled | +| curfewLockTime4 | Text | The curfew #4 locking time (HH:MM) | +| curfewUnlockTime4 | Text | The curfew #4 unlocking time (HH:MM) | +| lockingMode | Text | The locking mode (e.g. in/out, in-only, out-only etc.) | +| online | Switch | Indicator if the flap is connected to the hub | +| lowBattery | Switch | Indicator if the battery voltage is low | +| batteryLevel | Number:Dimensionless | The battery voltage percentage in % | +| batteryVoltage | Number:ElectricPotential | The absolute battery voltage measurement in V | +| deviceRSSI | Number:Power | The received device signal strength in dBm | +| hubRSSI | Number:Power | The received hub signal strength in dBm | ### Feeder Device Thing -| Channel | Type | Description | -|-------------------|--------------|-------------------------------------------------------------------------------------------------| -| id | Number | A unique id assigned by the Sure Petcare API | -| name | Text | The name of the feeder | -| product | Text | The type of product | -| online | Switch | Indicator if the feeder is connected to the hub | -| lowBattery | Switch | Indicator if the battery voltage is low | -| batteryLevel | Number | The battery voltage percentage | -| batteryVoltage | Number | The absolute battery voltage measurement | -| deviceRSSI | Number:Power | The received device signal strength in dB | -| hubRSSI | Number:Power | The received hub signal strength in dB | -| bowls | Text | The feeder bowls type (1 big bowl or 2 half bowls) | -| bowlsFood | Text | The feeder big bowl food type (wet food, dry food or both) | -| bowlsTarget | Number:Mass | The feeder big bowl target weight in gram (even if user setting is oz, API stores this in gram) | -| bowlsFoodLeft | Text | The feeder left half bowl food type (wet food, dry food or both) | -| bowlsTargetLeft | Number:Mass | The feeder left half bowl target weight | -| bowlsFoodRight | Text | The feeder right half bowl food type (wet food, dry food or both) | -| bowlsTargetRight | Number:Mass | The feeder right half bowl target weight | -| bowlsCloseDelay | Text | The feeder lid close delay (fast, normal, slow) | -| bowlsTrainingMode | Text | The feeder training mode (off, full open, almost full open, half closed, almost closed) | +| Channel | Type | Description | +|-------------------|---------------------------|-------------------------------------------------------------------------------------------------| +| id | Number | A unique id assigned by the Sure Petcare API | +| name | Text | The name of the feeder | +| product | Text | The type of product | +| online | Switch | Indicator if the feeder is connected to the hub | +| lowBattery | Switch | Indicator if the battery voltage is low | +| batteryLevel | Number:Dimensionless | The battery voltage percentage in % | +| batteryVoltage | Number:ElectricPotential | The absolute battery voltage measurement in V | +| deviceRSSI | Number:Power | The received device signal strength in dBm | +| hubRSSI | Number:Power | The received hub signal strength in dBm | +| bowls | Text | The feeder bowls type (1 big bowl or 2 half bowls) | +| bowlsFood | Text | The feeder big bowl food type (wet food, dry food or both) | +| bowlsTarget | Number:Mass | The feeder big bowl target weight in gram (even if user setting is oz, API stores this in gram) | +| bowlsFoodLeft | Text | The feeder left half bowl food type (wet food, dry food or both) | +| bowlsTargetLeft | Number:Mass | The feeder left half bowl target weight in g | +| bowlsFoodRight | Text | The feeder right half bowl food type (wet food, dry food or both) | +| bowlsTargetRight | Number:Mass | The feeder right half bowl target weight in g | +| bowlsCloseDelay | Text | The feeder lid close delay (fast, normal, slow) | +| bowlsTrainingMode | Text | The feeder training mode (off, full open, almost full open, half closed, almost closed) | + +### Waterstation Device Thing + +| Channel | Type | Description | +|-------------------|---------------------------|--------------------------------------------------------| +| id | Number | A unique id assigned by the Sure Petcare API | +| name | Text | The name of the waterstation | +| product | Text | The type of product | +| online | Switch | Indicator if the waterstation is connected to the hub | +| lowBattery | Switch | Indicator if the battery voltage is low | +| batteryLevel | Number:Dimensionless | The battery voltage percentage in % | +| batteryVoltage | Number:ElectricPotential | The absolute battery voltage measurement in V | +| deviceRSSI | Number:Power | The received device signal strength in dBm | +| hubRSSI | Number:Power | The received hub signal strength in dBm | ### Pet Thing -| Channel | Type | Description | -|------------------------|-------------|-------------------------------------------------------------------------------------| -| id | Number | A unique id assigned by the Sure Petcare API | -| name | Text | The name of the pet | -| comment | Text | A user provided comment/description | -| gender | Text | The pet's gender | -| breed | Text | The pet's breed | -| species | Text | The pet's species | -| photo | Image | The image of the pet | -| tagIdentifier | Text | The unique identifier of the pet's micro chip or collar tag | -| location | Text | The current location of the pet (0=unknown, 1=inside, 2=outside) | -| locationChanged | DateTime | The time when the location was last changed | -| locationTimeoffset | String | Time-Command to set the pet location with a time offset. (10, 30 or 60 minutes ago) | -| locationChangedThrough | Text | The device name or username where the pet left/entered the house | -| weight | Number:Mass | The pet's weight (in gram) | -| dateOfBirth | DateTime | The pet's date of birth | -| feederDevice | Text | The device from which the pet last ate | -| feederLastChange | Number:Mass | The last eaten change in gram (big bowl) | -| feederLastChangeLeft | Number:Mass | The last eaten change in gram (half bowl left) | -| feederLastChangeRight | Number:Mass | The last eaten change in gram (half bowl right) | -| feederLastFeeding | DateTime | The pet's last eaten date | +| Channel | Type | Description | +|------------------------|----------------|-------------------------------------------------------------------------------------| +| id | Number | A unique id assigned by the Sure Petcare API | +| name | Text | The name of the pet | +| comment | Text | A user provided comment/description | +| gender | Text | The pet's gender | +| breed | Text | The pet's breed | +| species | Text | The pet's species | +| photo | Image | The image of the pet | +| tagIdentifier | Text | The unique identifier of the pet's micro chip or collar tag | +| location | Text | The current location of the pet (0=unknown, 1=inside, 2=outside) | +| locationChanged | DateTime | The time when the location was last changed | +| locationTimeoffset | String | Time-Command to set the pet location with a time offset. (10, 30 or 60 minutes ago) | +| locationChangedThrough | Text | The device name or username where the pet left/entered the house | +| weight | Number:Mass | The pet's weight (in gram) | +| dateOfBirth | DateTime | The pet's date of birth | +| feederDevice | Text | The device from which the pet last ate | +| feederLastChange | Number:Mass | The last eaten change in gram (big bowl) | +| feederLastChangeLeft | Number:Mass | The last eaten change in gram (half bowl left) | +| feederLastChangeRight | Number:Mass | The last eaten change in gram (half bowl right) | +| feederLastFeeding | DateTime | The pet's last eaten date | +| waterDevice | Text | The device from which the pet last drunk | +| waterLastChange | Number:Volume | The last drinking change in milliliter (ml) | +| waterLastDrinking | DateTime | The pet's last drinking date | ## Manual configuration @@ -158,110 +176,310 @@ Bridge surepetcare:bridge:bridge1 "Demo API Bridge" @ "SurePetcare" [ username=" Thing hubDevice 123456 "My SurePetcare Hub" @ "SurePetcare Devices" Thing flapDevice 123456 "My Backdoor Cat Flap" @ "SurePetcare Devices" Thing feederDevice 123456 "My Pet Feeder" @ "SurePetcare Devices" + Thing waterDevice 123456 "My Pet Waterstation" @ "SurePetcare Devices" Thing pet 12345 "My Cat" @ "SurePetcare Pets" } ``` ### Items configuration +
+New Items with Points (semantic model) +Choose "Create Equipment from Thing" -> select Thing -> Channels click on Expert Mode + +```java +// Equipment representing thing: +// surepetcare:bridge:api +// (SurePetcare API Konto) +Group gSurePetcare "SurePetcare API Konto" (gLivingRoom) ["WebService"] +Switch SurePet_API_Refresh "Aktualisieren" (gSurePetcare) ["Point"] {channel="surepetcare:bridge:api:refresh"} + +// Equipment representing thing: +// surepetcare:household:api:CHANGE_ME +// (SurePetcare Haushalt EddyMurphy) +Group gSurePetcareHousehold "SurePetcare Haushalt EddyMurphy" (gSurePetcare) ["Equipment"] +Number SurePet_HouseholdId_1 "Haushalt ID" (gSurePetcareHousehold) ["Point"] {channel="surepetcare:household:api:CHANGE_ME:id"} +String SurePet_HouseholdName_1 "Haushalt Name" (gSurePetcareHousehold) ["Point"] {channel="surepetcare:household:api:CHANGE_ME:name"} +Number SurePet_HouseholdTimezoneId_1 "Haushalt Zeitzone ID" (gSurePetcareHousehold) ["Point"] {channel="surepetcare:household:api:CHANGE_ME:timezoneId"} + +Group gSurePetcareDevices "SurePetcare Geräte" (gSurePetcareHousehold) ["Equipment"] +// Equipment representing thing: +// surepetcare:hubDevice:api:CHANGE_ME +// (SurePetcare Hub Home) +Group gSurePetcareHub "SurePetcare Hub Home" (gSurePetcareDevices) ["Equipment"] +Number SurePet_HubId_1 "Hub ID" (gSurePetcareHub) ["Point"] {channel="surepetcare:hubDevice:api:CHANGE_ME:id"} +String SurePet_HubName_1 "Hub Name" (gSurePetcareHub) ["Point"] {channel="surepetcare:hubDevice:api:CHANGE_ME:name"} +String SurePet_HubProduct_1 "Hub Produkt Typ" (gSurePetcareHub) ["Point"] {channel="surepetcare:hubDevice:api:CHANGE_ME:product"} +String SurePet_HubLedMode_1 "Hub Led Modus" (gSurePetcareHub) ["Point"] {channel="surepetcare:hubDevice:api:CHANGE_ME:ledMode"} +String SurePet_HubPairingMode_1 "Hub Paarungs Modus" (gSurePetcareHub) ["Point"] {channel="surepetcare:hubDevice:api:CHANGE_ME:pairingMode"} +Switch SurePet_HubOnline_1 "Hub Online Status" (gSurePetcareHub) ["Point"] {channel="surepetcare:hubDevice:api:CHANGE_ME:online"} + +// Equipment representing thing: +// surepetcare:flapDevice:api:CHANGE_ME +// (SurePetcare Klappe Bad) +Group gSurePetcareFlap "SurePetcare Klappe Bad" (gSurePetcareDevices) ["Equipment"] +Number SurePet_FlapId_1 "Flap ID" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:id"} +String SurePet_FlapName_1 "Flap Name" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:name"} +String SurePet_FlapProduct_1 "Flap Produkt Typ" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:product"} +Switch SurePet_FlapCurfewEnabled1_1 "Flap Ausgangssperre 1 Aktiv" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewEnabled1"} +String SurePet_FlapCurfewLockTime1_1 "Flap Ausgangssperre 1 Sperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewLockTime1"} +String SurePet_FlapCurfewUnlockTime1_1 "Flap Ausgangssperre 1 Entsperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewUnlockTime1"} +Switch SurePet_FlapCurfewEnabled2_1 "Flap Ausgangssperre 2 Aktiv" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewEnabled2"} +String SurePet_FlapCurfewLockTime2_1 "Flap Ausgangssperre 2 Sperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewLockTime2"} +String SurePet_FlapCurfewUnlockTime2_1 "Flap Ausgangssperre 2 Entsperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewUnlockTime2"} +Switch SurePet_FlapCurfewEnabled3_1 "Flap Ausgangssperre 3 Aktiv" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewEnabled3"} +String SurePet_FlapCurfewLockTime3_1 "Flap Ausgangssperre 3 Sperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewLockTime3"} +String SurePet_FlapCurfewUnlockTime3_1 "Flap Ausgangssperre 3 Entsperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewUnlockTime3"} +Switch SurePet_FlapCurfewEnabled4_1 "Flap Ausgangssperre 4 Aktiv" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewEnabled4"} +String SurePet_FlapCurfewLockTime4_1 "Flap Ausgangssperre 4 Sperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewLockTime4"} +String SurePet_FlapCurfewUnlockTime4_1 "Flap Ausgangssperre 4 Entsperrzeit" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:curfewUnlockTime4"} +String SurePet_FlapLockingMode_1 "Flap Sperrmodus" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:lockingMode"} +Switch SurePet_FlapLowBattery_1 "Flap Niedriger Batteriestatus" (gSurePetcareFlap) ["Energy", "LowBattery"] {channel="surepetcare:flapDevice:api:CHANGE_ME:lowBattery"} +Number:Dimensionless SurePet_FlapBatteryLevel_1 "Flap Batterieladung" (gSurePetcareFlap) ["Measurement", "Energy"] {channel="surepetcare:flapDevice:api:CHANGE_ME:batteryLevel", stateDescription="%.0f %%", unit="%"} +Number:ElectricPotential SurePet_FlapBatteryVoltage_1 "Flap Batterie Spannung" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:batteryVoltage", stateDescription="%.1f V", unit="V"} +Switch SurePet_FlapOnline_1 "Flap Online Status" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:online"} +Number:Power SurePet_FlapDeviceRSSI_1 "Flap Signalstärke (Gerät)" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:deviceRSSI", stateDescription="%.2f dBm", unit="dBm"} +Number:Power SurePet_FlapHubRSSI_1 "Flap Signalstärke (Hub)" (gSurePetcareFlap) ["Point"] {channel="surepetcare:flapDevice:api:CHANGE_ME:hubRSSI", stateDescription="%.2f dBm", unit="dBm"} + +// Equipment representing thing: +// surepetcare:feederDevice:api:CHANGE_ME +// (SurePetcare Futterautomat Luna) +Group gSurePetcareDevice1 "SurePetcare Futterautomat Luna" (gSurePetcareDevices) ["Equipment"] +Number SurePet_FeederId_1 "Futterautomat ID" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:id"} +String SurePet_FeederName_1 "Futterautomat Name" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:name"} +String SurePet_FeederProduct_1 "Futterautomat Produkt Typ" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:product"} +Switch SurePet_FeederLowBattery_1 "Futterautomat Niedriger Batteriestatus" (gSurePetcareDevice1) ["Energy", "LowBattery"] {channel="surepetcare:feederDevice:api:CHANGE_ME:lowBattery"} +Number:Dimensionless SurePet_FeederBatteryLevel_1 "Futterautomat Batterieladung" (gSurePetcareDevice1) ["Measurement", "Energy"] {channel="surepetcare:feederDevice:api:CHANGE_ME:batteryLevel", stateDescription="%.0f %%", unit="%"} +Number:ElectricPotential SurePet_FeederBatteryVoltage_1 "Futterautomat Batterie Spannung" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:batteryVoltage", stateDescription="%.1f V", unit="V"} +Switch SurePet_FeederOnline_1 "Futterautomat Online Status" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:online"} +Number:Power SurePet_FeederDeviceRSSI_1 "Futterautomat Signalstärke (Gerät)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:deviceRSSI", stateDescription="%.2f dBm", unit="dBm"} +Number:Power SurePet_FeederHubRSSI_1 "Futterautomat Signalstärke (Hub)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:hubRSSI", stateDescription="%.2f dBm", unit="dBm"} +String SurePet_FeederBowlsFood_1 "Futterautomat Napf Futter Typ (großer Napf)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsFood"} +Number:Mass SurePet_FeederBowlsTarget_1 "Futterautomat Napf Gewicht (großer Napf)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTarget", stateDescription="%.0f g", unit="g"} +String SurePet_FeederBowlsFoodLeft_1 "Futterautomat Napf Futter Typ links (halbe Näpfe)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsFoodLeft"} +Number:Mass SurePet_FeederBowlsTargetLeft_1 "Futterautomat Napf Gewicht links (halbe Näpfe)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTargetLeft", stateDescription="%.0f g", unit="g"} +String SurePet_FeederBowlsFoodRight_1 "Futterautomat Napf Futter Typ rechts (halbe Näpfe)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsFoodRight"} +Number:Mass SurePet_FeederBowlsTargetRight_1 "Futterautomat Napf Gewicht rechts (halbe Näpfe)" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTargetRight", stateDescription="%.0f g", unit="g"} +String SurePet_FeederBowls_1 "Futterautomat Napf Typ" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowls"} +String SurePet_FeederBowlsCloseDelay_1 "Futterautomat Deckel Schließverzögerung" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsCloseDelay"} +String SurePet_FeederBowlsTrainingMode_1 "Futterautomat Futterautomat Training Modus" (gSurePetcareDevice1) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTrainingMode"} + +// Equipment representing thing: +// surepetcare:feederDevice:api:CHANGE_ME +// (SurePetcare Futterautomat Rudi) +Group gSurePetcareDevice2 "SurePetcare Futterautomat Rudi" (gSurePetcareDevices) ["Equipment"] +Number SurePet_FeederId_2 "Futterautomat ID" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:id"} +String SurePet_FeederName_2 "Futterautomat Name" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:name"} +String SurePet_FeederProduct_2 "Futterautomat Produkt Typ" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:product"} +Switch SurePet_FeederLowBattery_2 "Futterautomat Niedriger Batteriestatus" (gSurePetcareDevice2) ["Energy", "LowBattery"] {channel="surepetcare:feederDevice:api:CHANGE_ME:lowBattery"} +Number:Dimensionless SurePet_FeederBatteryLevel_2 "Futterautomat Batterieladung" (gSurePetcareDevice2) ["Measurement", "Energy"] {channel="surepetcare:feederDevice:api:CHANGE_ME:batteryLevel", stateDescription="%.0f %%", unit="%"} +Number:ElectricPotential SurePet_FeederBatteryVoltage_2 "Futterautomat Batterie Spannung" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:batteryVoltage", stateDescription="%.1f V", unit="V"} +Switch SurePet_FeederOnline_2 "Futterautomat Online Status" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:online"} +Number:Power SurePet_FeederDeviceRSSI_2 "Futterautomat Signalstärke (Gerät)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:deviceRSSI", stateDescription="%.2f dBm", unit="dBm"} +Number:Power SurePet_FeederHubRSSI_2 "Futterautomat Signalstärke (Hub)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:hubRSSI", stateDescription="%.2f dBm", unit="dBm"} +String SurePet_FeederBowlsFood_2 "Futterautomat Napf Futter Typ (großer Napf)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsFood"} +Number:Mass SurePet_FeederBowlsTarget_2 "Futterautomat Napf Gewicht (großer Napf)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTarget", stateDescription="%.0f g", unit="g"} +String SurePet_FeederBowlsFoodLeft_2 "Futterautomat Napf Futter Typ links (halbe Näpfe)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsFoodLeft"} +Number:Mass SurePet_FeederBowlsTargetLeft_2 "Futterautomat Napf Gewicht links (halbe Näpfe)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTargetLeft", stateDescription="%.0f g", unit="g"} +String SurePet_FeederBowlsFoodRight_2 "Futterautomat Napf Futter Typ rechts (halbe Näpfe)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsFoodRight"} +Number:Mass SurePet_FeederBowlsTargetRight_2 "Futterautomat Napf Gewicht rechts (halbe Näpfe)" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTargetRight", stateDescription="%.0f g", unit="g"} +String SurePet_FeederBowls_2 "Futterautomat Napf Typ" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowls"} +String SurePet_FeederBowlsCloseDelay_2 "Futterautomat Deckel Schließverzögerung" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsCloseDelay"} +String SurePet_FeederBowlsTrainingMode_2 "Futterautomat Futterautomat Training Modus" (gSurePetcareDevice2) ["Point"] {channel="surepetcare:feederDevice:api:CHANGE_ME:bowlsTrainingMode"} + +// Equipment representing thing: +// surepetcare:waterDevice:api:CHANGE_ME +// (SurePetcare - Poseidon) +Group gSurePetcareDevice3 "Wasserstation Poseidon" (gSurePetcareDevices) ["Equipment"] +Number SurePet_Poseidon_ID "Wasserstation ID" (gSurePetcareDevice3) ["Point"] {channel="surepetcare:waterDevice:api:CHANGE_ME:id"} +String SurePet_Poseidon_Name "Wasserstation Name" (gSurePetcareDevice3) ["Point"] {channel="surepetcare:waterDevice:api:CHANGE_ME:name"} +String SurePet_Poseidon_Product "Wasserstation Produkt Typ" (gSurePetcareDevice3) ["Point"] {channel="surepetcare:waterDevice:api:CHANGE_ME:product"} +Switch SurePet_Poseidon_LowBattery "Wasserstation Niedriger Batteriestatus" (gSurePetcareDevice3) ["Energy", "LowBattery"] {channel="surepetcare:waterDevice:api:CHANGE_ME:lowBattery"} +Number:Dimensionless SurePet_Poseidon_BatteryLevel "Wasserstation Batterieladung" (gSurePetcareDevice3) ["Measurement", "Energy"] {channel="surepetcare:waterDevice:api:CHANGE_ME:batteryLevel", stateDescription="%.0f %%", unit="%"} +Number:ElectricPotential SurePet_Poseidon_BatteryVolatge "Wasserstation Batterie Spannung" (gSurePetcareDevice3) ["Point"] {channel="surepetcare:waterDevice:api:CHANGE_ME:batteryVoltage", stateDescription="%.1f V", unit="V"} +Switch SurePet_Poseidon_Online "Wasserstation Online Status" (gSurePetcareDevice3) ["Point"] {channel="surepetcare:waterDevice:api:CHANGE_ME:online"} +Number:Power SurePet_Poseidon_DeviceRSSI "Wasserstation Signalstärke (Gerät)" (gSurePetcareDevice3) ["Point"] {channel="surepetcare:waterDevice:api:CHANGE_ME:deviceRSSI", stateDescription="%.2f dBm", unit="dBm"} +Number:Power SurePet_Poseidon_HubRSSI "Wasserstation Signalstärke (Hub)" (gSurePetcareDevice3) ["Point"] {channel="surepetcare:waterDevice:api:CHANGE_ME:hubRSSI", stateDescription="%.2f dBm", unit="dBm"} + + +Group gSurePetcarePets "SurePetcare Haustiere" (gSurePetcareHousehold) ["Equipment"] +// Equipment representing thing: +// surepetcare:pet:api:CHANGE_ME +// (SurePetcare Haustier Luna) +Group gSurePetcarePet1 "SurePetcare Haustier Luna" (gSurePetcarePets) ["Equipment"] +Number SurePet_Id_1 "Tier ID" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:id"} +String SurePet_Name_1 "Tier Name" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:name"} +String SurePet_Comment_1 "Tier Kommentar" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:comment"} +String SurePet_Gender_1 "Tier Geschlecht" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:gender"} +String SurePet_Breed_1 "Tier Rasse" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:breed"} +String SurePet_Species_1 "Tier Tierart" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:species"} +Image SurePet_Photo_1 "Tier Foto" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:photo"} +String SurePet_TagIdentifier_1 "Tier Mikrochip" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:tagIdentifier"} +String SurePet_Location_1 "Wo ist Luna" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:location"} +DateTime SurePet_LocationChanged_1 "Tier Standort Zeit" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:locationChanged", stateDescription="%1$ta. %1$tH:%1$tM"} +String SurePet_LocationTimeoffset_1 "Tier Standortwechsel Zeitversatz" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:locationTimeoffset"} +String SurePet_LocationChangedThrough_1 "Tier Standort geändert durch" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:locationChangedThrough"} +DateTime SurePet_DateOfBirth_1 "Tier Geburtstag" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:dateOfBirth", stateDescription="%1$td.%1$tm.%1$tY"} +Number:Mass SurePet_Weight_1 "Tier Gewicht" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:weight", stateDescription="%.1f kg", unit="g"} +String SurePet_FeederDevice_1 "Tier Futterautomat Name" (gSurePetcarePet1) ["Point"] {channel="surepetcare:pet:api:CHANGE_ME:feederDevice"} +DateTime SurePet_FeederLastFeeding_1 "Tier Letzte Futteraufnahme"
+ +
+Old Items file + ```java /* ***************************************** * Bridge * *****************************************/ Group dgPet -Switch UR_1a_Online "Bridge Online [%s]" (dgPet) {channel="surepetcare:bridge:bridge1:online"} -Switch UR_1a_Refresh "Bridge Data Refresh [%s]" (dgPet) {channel="surepetcare:bridge:bridge1:refresh"} +Switch UR_1a_Online "Bridge Online [%s]" (dgPet) {channel="surepetcare:bridge:bridge1:online"} +Switch UR_1a_Refresh "Bridge Data Refresh [%s]" (dgPet) {channel="surepetcare:bridge:bridge1:refresh"} /* ***************************************** * Household * *****************************************/ -Number UR_1b_Id "Household Id [%d]" (dgPet) {channel="surepetcare:household:bridge1:12345:id"} -String UR_1b_Name "Household Name [%s]" (dgPet) {channel="surepetcare:household:bridge1:12345:name"} -Number UR_1b_TimezoneId "Household Timezone Id [%d]" (dgPet) {channel="surepetcare:household:bridge1:12345:timezoneId"} +Number UR_1b_Id "Household Id [%d]" (dgPet) {channel="surepetcare:household:bridge1:12345:id"} +String UR_1b_Name "Household Name [%s]" (dgPet) {channel="surepetcare:household:bridge1:12345:name"} +Number UR_1b_TimezoneId "Household Timezone Id [%d]" (dgPet) {channel="surepetcare:household:bridge1:12345:timezoneId"} /* ***************************************** * Hub * *****************************************/ -Number UR_1c_Id "Hub Id [%d]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:id"} -String UR_1c_Name "Hub Name [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:name"} -String UR_1c_Product "Hub Product [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:product"} -String UR_1c_LEDMode "Hub LED Mode [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:ledMode"} -String UR_1c_PairingMode "Hub Pairing Mode [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:pairingMode"} -Switch UR_1c_Online "Hub Online [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:online"} +Number UR_1c_Id "Hub Id [%d]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:id"} +String UR_1c_Name "Hub Name [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:name"} +String UR_1c_Product "Hub Product [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:product"} +String UR_1c_LEDMode "Hub LED Mode [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:ledMode"} +String UR_1c_PairingMode "Hub Pairing Mode [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:pairingMode"} +Switch UR_1c_Online "Hub Online [%s]" (dgPet) {channel="surepetcare:hubDevice:bridge1:123456:online"} /* ***************************************** * Cat/Pet Flap * *****************************************/ -Number UR_1d_Id "Flap Id [%d]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:id"} -String UR_1d_Name "Flap Name [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:name"} -String UR_1d_Product "Flap Product [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:product"} -Switch UR_1d_CurfewEnabled1 "Flap Curfew 1 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled1"} -String UR_1d_CurfewLockTime1 "Flap Curfew 1 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime1"} -String UR_1d_CurfewUnlockTime1 "Flap Curfew 1 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime1"} -Switch UR_1d_CurfewEnabled2 "Flap Curfew 2 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled2"} -String UR_1d_CurfewLockTime2 "Flap Curfew 2 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime2"} -String UR_1d_CurfewUnlockTime2 "Flap Curfew 2 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime2"} -Switch UR_1d_CurfewEnabled3 "Flap Curfew 3 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled3"} -String UR_1d_CurfewLockTime3 "Flap Curfew 3 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime3"} -String UR_1d_CurfewUnlockTime3 "Flap Curfew 3 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime3"} -Switch UR_1d_CurfewEnabled4 "Flap Curfew 4 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled4"} -String UR_1d_CurfewLockTime4 "Flap Curfew 4 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime4"} -String UR_1d_CurfewUnlockTime5 "Flap Curfew 4 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime4"} -String UR_1d_LockingMode "Flap Locking Mode [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:lockingMode"} -Switch UR_1d_LowBattery "Flap Low Battery [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:lowBattery"} -Number UR_1d_BatteryLevel "Flap Battery Level [%.0f %%]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:batteryLevel"} -Number UR_1d_BatteryVoltage "Flap Battery Voltage [%.1f V]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:batteryVoltage"} -Switch UR_1d_Online "Flap Online [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:online"} -Number UR_1d_DeviceRSSI "Flap Device RSSI [%.2f dB]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:deviceRSSI"} -Number UR_1d_HubRSSI "Flap Hub RSSI [%.2f dB]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:hubRSSI"} +Number UR_1d_Id "Flap Id [%d]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:id"} +String UR_1d_Name "Flap Name [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:name"} +String UR_1d_Product "Flap Product [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:product"} +Switch UR_1d_CurfewEnabled1 "Flap Curfew 1 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled1"} +String UR_1d_CurfewLockTime1 "Flap Curfew 1 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime1"} +String UR_1d_CurfewUnlockTime1 "Flap Curfew 1 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime1"} +Switch UR_1d_CurfewEnabled2 "Flap Curfew 2 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled2"} +String UR_1d_CurfewLockTime2 "Flap Curfew 2 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime2"} +String UR_1d_CurfewUnlockTime2 "Flap Curfew 2 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime2"} +Switch UR_1d_CurfewEnabled3 "Flap Curfew 3 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled3"} +String UR_1d_CurfewLockTime3 "Flap Curfew 3 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime3"} +String UR_1d_CurfewUnlockTime3 "Flap Curfew 3 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime3"} +Switch UR_1d_CurfewEnabled4 "Flap Curfew 4 Enabled [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewEnabled4"} +String UR_1d_CurfewLockTime4 "Flap Curfew 4 Lock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewLockTime4"} +String UR_1d_CurfewUnlockTime5 "Flap Curfew 4 Unlock Time [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:curfewUnlockTime4"} +String UR_1d_LockingMode "Flap Locking Mode [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:lockingMode"} +Switch UR_1d_LowBattery "Flap Low Battery [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:lowBattery"} +Number:Dimensionless UR_1d_BatteryLevel "Flap Battery Level [%.0f %%]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:batteryLevel"} +Number:ElectricPotential UR_1d_BatteryVoltage "Flap Battery Voltage [%.1f V]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:batteryVoltage"} +Switch UR_1d_Online "Flap Online [%s]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:online"} +Number:Power UR_1d_DeviceRSSI "Flap Device RSSI [%.2f dBm]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:deviceRSSI"} +Number:Power UR_1d_HubRSSI "Flap Hub RSSI [%.2f dBm]" (dgPet) {channel="surepetcare:flapDevice:bridge1:123456:hubRSSI"} /* ***************************************** * Pet * *****************************************/ -Number UR_1e_Id "Pet Id [%d]" (dgPet) {channel="surepetcare:pet:bridge1:12345:id"} -String UR_1e_Name "Pet Name [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:name"} -String UR_1e_Comment "Pet Comment [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:comment"} -String UR_1e_Gender "Pet Gender [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:gender"} -String UR_1e_Breed "Pet Breed [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:breed"} -String UR_1e_Species "Pet Species [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:species"} -Image UR_1e_Photo "Pet Photo" (dgPet) {channel="surepetcare:pet:bridge1:12345:photo"} -String UR_1e_TagIdentifier "Pet Tag Identifier [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:tagIdentifier"} -String UR_1e_Location "Pet Location [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:location"} -String UR_1e_LocationTimeoffset"Pet Switch Location [%s]" (gCats) {channel="surepetcare:pet:bridge1:20584:locationTimeoffset"} -DateTime UR_1e_LocationChanged "Pet Loc. Updated [%1$ta. %1$tH:%1$tM]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChanged"} -String UR_1e_LocationThrough "Pet Entered / Left through [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChangedThrough"} -Number:Mass UR_1e_Weight "Pet Weight [%.1f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:weight"} -DateTime UR_1e_DateOfBirth "Pet Date of Birth [%1$td.%1$tm.%1$tY]" (dgPet) {channel="surepetcare:pet:bridge1:12345:dateOfBirth"} +Number UR_1e_Id "Pet Id [%d]" (dgPet) {channel="surepetcare:pet:bridge1:12345:id"} +String UR_1e_Name "Pet Name [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:name"} +String UR_1e_Comment "Pet Comment [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:comment"} +String UR_1e_Gender "Pet Gender [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:gender"} +String UR_1e_Breed "Pet Breed [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:breed"} +String UR_1e_Species "Pet Species [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:species"} +Image UR_1e_Photo "Pet Photo" (dgPet) {channel="surepetcare:pet:bridge1:12345:photo"} +String UR_1e_TagIdentifier "Pet Tag Identifier [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:tagIdentifier"} +String UR_1e_Location "Pet Location [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:location"} +String UR_1e_LocationTimeoffset "Pet Switch Location [%s]" (gCats) {channel="surepetcare:pet:bridge1:20584:locationTimeoffset"} +DateTime UR_1e_LocationChanged "Pet Loc. Updated [%1$ta. %1$tH:%1$tM]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChanged"} +String UR_1e_LocationThrough "Pet Entered / Left through [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:locationChangedThrough"} +Number:Mass UR_1e_Weight "Pet Weight [%.1f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:weight"} +DateTime UR_1e_DateOfBirth "Pet Date of Birth [%1$td.%1$tm.%1$tY]" (dgPet) {channel="surepetcare:pet:bridge1:12345:dateOfBirth"} // Pet Feeder Data -String UR_1e_Device "Device Name [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederDevice"} -Number:Mass UR_1e_Change "Change: [%.2f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastChange"} -Number:Mass UR_1e_ChangeLeft "Change: L [%.2f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastChangeLeft"} -Number:Mass UR_1e_ChangeRight "Change: R [%.2f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastChangeRight"} -DateTime UR_1e_FeedAt "Last Feeding [%1$ta. %1$tH:%1$tM]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastFeeding"} +String UR_1e_Device "Device Name [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederDevice"} +Number:Mass UR_1e_Change "Change: [%.2f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastChange"} +Number:Mass UR_1e_ChangeLeft "Change: L [%.2f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastChangeLeft"} +Number:Mass UR_1e_ChangeRight "Change: R [%.2f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastChangeRight"} +DateTime UR_1e_FeedAt "Last Feeding [%1$ta. %1$tH:%1$tM]" (dgPet) {channel="surepetcare:pet:bridge1:12345:feederLastFeeding"} +// Pet Water Data +String UR_1e_WaterDevice "Device Name [%s]" (dgPet) {channel="surepetcare:pet:bridge1:12345:waterDevice"} +Number:Volume UR_1e_WaterChange "Change: [%.2f %unit%]" (dgPet) {channel="surepetcare:pet:bridge1:12345:waterLastChange"} +DateTime UR_1e_WaterDrunkAt "Last Drinking [%1$ta. %1$tH:%1$tM]" (dgPet) {channel="surepetcare:pet:bridge1:12345:waterLastDrinking"} /* ***************************************** * Pet Feeder * *****************************************/ -Number UR_1f_Id "Feeder ID [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:id"} -String UR_1f_Name "Feeder Name [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:name"} -String UR_1f_Product "Feeder Product [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:product"} -Switch UR_1f_LowBattery "Feeder Low Battery [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:lowBattery"} -Number UR_1f_BatteryLevel "Feeder Battery Level [%.0f %%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:batteryLevel"} -Number UR_1f_BatteryVoltage "Feeder Battery Voltage [%.2f V]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:batteryVoltage"} -String UR_1f_BowlsType "Feeder Bowls Type [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowls"} -String UR_1f_BowlsFoodtype "Feeder Food Type [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsFood"} -Number:Mass UR_1f_BowlsTarget "Feeder Target [%.0f %unit%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTarget"} -String UR_1f_BowlsFoodtypeLeft "Feeder Food Type L [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsFoodLeft"} -Number:Mass UR_1f_BowlsTargetLeft "Feeder Target L [%.0f %unit%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTargetLeft"} -String UR_1f_BowlsFoodtypeRight "Feeder Food Type R [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsFoodRight"} -Number:Mass UR_1f_BowlsTargetRight "Feeder Target R [%.0f %unit%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTargetRight"} -String UR_1f_BowlsLidCloseDelay "Feeder Close Delay [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsCloseDelay"} -String UR_1f_BowlsTrainingMode "Feeder Training Mode [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTrainingMode"} -Switch UR_1f_Online "Feeder Status [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:online"} -Number UR_1f_DeviceRSSI "Feeder Device Signal [%.2f dB]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:deviceRSSI"} -Number UR_1f_HubRSSI "Feeder Hub Signal [%.2f dB]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:hubRSSI"} +Number UR_1f_Id "Feeder ID [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:id"} +String UR_1f_Name "Feeder Name [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:name"} +String UR_1f_Product "Feeder Product [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:product"} +Switch UR_1f_LowBattery "Feeder Low Battery [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:lowBattery"} +Number:Dimensionless UR_1f_BatteryLevel "Feeder Battery Level [%.0f %%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:batteryLevel"} +Number:ElectricPotential UR_1f_BatteryVoltage "Feeder Battery Voltage [%.2f V]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:batteryVoltage"} +String UR_1f_BowlsType "Feeder Bowls Type [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowls"} +String UR_1f_BowlsFoodtype "Feeder Food Type [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsFood"} +Number:Mass UR_1f_BowlsTarget "Feeder Target [%.0f %unit%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTarget"} +String UR_1f_BowlsFoodtypeLeft "Feeder Food Type L [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsFoodLeft"} +Number:Mass UR_1f_BowlsTargetLeft "Feeder Target L [%.0f %unit%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTargetLeft"} +String UR_1f_BowlsFoodtypeRight "Feeder Food Type R [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsFoodRight"} +Number:Mass UR_1f_BowlsTargetRight "Feeder Target R [%.0f %unit%]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTargetRight"} +String UR_1f_BowlsLidCloseDelay "Feeder Close Delay [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsCloseDelay"} +String UR_1f_BowlsTrainingMode "Feeder Training Mode [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:bowlsTrainingMode"} +Switch UR_1f_Online "Feeder Status [%s]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:online"} +Number:Power UR_1f_DeviceRSSI "Feeder Device Signal [%.2f dBm]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:deviceRSSI"} +Number:Power UR_1f_HubRSSI "Feeder Hub Signal [%.2f dBm]" (dgPet) {channel="surepetcare:feederDevice:bridge1:123456:hubRSSI"} + +/* ***************************************** + * Pet Waterstation + * *****************************************/ +Number UR_1g_Id "Waterstation ID [%s]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:id"} +String UR_1g_Name "Waterstation Name [%s]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:name"} +String UR_1g_Product "Waterstation Product [%s]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:product"} +Switch UR_1g_LowBattery "Waterstation Low Battery [%s]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:lowBattery"} +Number:Dimensionless UR_1g_BatteryLevel "Waterstation Battery Level [%.0f %%]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:batteryLevel"} +Number:ElectricPotential UR_1g_BatteryVoltage "Waterstation Battery Voltage [%.2f V]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:batteryVoltage"} +Switch UR_1g_Online "Waterstation Status [%s]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:online"} +Number:Power UR_1g_DeviceRSSI "Waterstation Device Signal [%.2f dBm]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:deviceRSSI"} +Number:Power UR_1g_HubRSSI "Waterstation Hub Signal [%.2f dBm]" (dgPet) {channel="surepetcare:waterDevice:bridge1:123456:hubRSSI"} ``` +
+ ### Sitemap Configuration ```perl diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareConstants.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareConstants.java index 81ca90a8d0020..725498f7ab188 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareConstants.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareConstants.java @@ -46,10 +46,12 @@ public class SurePetcareConstants { public static final ThingTypeUID THING_TYPE_HUB_DEVICE = new ThingTypeUID(BINDING_ID, "hubDevice"); public static final ThingTypeUID THING_TYPE_FLAP_DEVICE = new ThingTypeUID(BINDING_ID, "flapDevice"); public static final ThingTypeUID THING_TYPE_FEEDER_DEVICE = new ThingTypeUID(BINDING_ID, "feederDevice"); + public static final ThingTypeUID THING_TYPE_WATER_DEVICE = new ThingTypeUID(BINDING_ID, "waterDevice"); public static final Set BRIDGE_THING_TYPES_UIDS = Set.of(THING_TYPE_BRIDGE); - public static final Set SUPPORTED_THING_TYPES_UIDS = new HashSet<>(Arrays.asList(THING_TYPE_HOUSEHOLD, - THING_TYPE_PET, THING_TYPE_HUB_DEVICE, THING_TYPE_FLAP_DEVICE, THING_TYPE_FEEDER_DEVICE)); + public static final Set SUPPORTED_THING_TYPES_UIDS = new HashSet<>( + Arrays.asList(THING_TYPE_HOUSEHOLD, THING_TYPE_PET, THING_TYPE_HUB_DEVICE, THING_TYPE_FLAP_DEVICE, + THING_TYPE_FEEDER_DEVICE, THING_TYPE_WATER_DEVICE)); public static final long DEFAULT_REFRESH_INTERVAL_TOPOLOGY = 36000; // 10 hours public static final long DEFAULT_REFRESH_INTERVAL_STATUS = 300; // 5 mins @@ -122,4 +124,7 @@ public class SurePetcareConstants { public static final String PET_CHANNEL_FEEDER_LAST_CHANGE = "feederLastChange"; public static final String PET_CHANNEL_FEEDER_LAST_CHANGE_LEFT = "feederLastChangeLeft"; public static final String PET_CHANNEL_FEEDER_LAST_CHANGE_RIGHT = "feederLastChangeRight"; + public static final String PET_CHANNEL_WATER_DEVICE = "waterDevice"; + public static final String PET_CHANNEL_WATER_LASTDRINKING = "waterLastDrinking"; + public static final String PET_CHANNEL_WATER_LAST_CHANGE = "waterLastChange"; } diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareHandlerFactory.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareHandlerFactory.java index 8e2e320164a67..4a839f9ec531c 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareHandlerFactory.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/SurePetcareHandlerFactory.java @@ -80,6 +80,8 @@ public boolean supportsThingType(ThingTypeUID thingTypeUID) { return new SurePetcareDeviceHandler(thing, petcareAPI); } else if (thingTypeUID.equals(THING_TYPE_FEEDER_DEVICE)) { return new SurePetcareDeviceHandler(thing, petcareAPI); + } else if (thingTypeUID.equals(THING_TYPE_WATER_DEVICE)) { + return new SurePetcareDeviceHandler(thing, petcareAPI); } else if (thingTypeUID.equals(THING_TYPE_PET)) { return new SurePetcarePetHandler(thing, petcareAPI); } else if (thingTypeUID.equals(THING_TYPE_BRIDGE)) { diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/discovery/SurePetcareDiscoveryService.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/discovery/SurePetcareDiscoveryService.java index c7901a6aa597a..273746e498bbb 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/discovery/SurePetcareDiscoveryService.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/discovery/SurePetcareDiscoveryService.java @@ -149,6 +149,9 @@ private void deviceDiscovered(SurePetcareDevice device) { case PET_FEEDER: typeUID = THING_TYPE_FEEDER_DEVICE; break; + case PET_WATER: + typeUID = THING_TYPE_WATER_DEVICE; + break; case UNKNOWN: default: return; diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcareDevice.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcareDevice.java index 3641daac6c157..9c8078924af4a 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcareDevice.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcareDevice.java @@ -34,7 +34,8 @@ public enum ProductType { HUB(1, "Hub"), PET_FLAP(3, "Pet Flap"), PET_FEEDER(4, "Pet Feeder"), - CAT_FLAP(6, "Cat Flap"); + CAT_FLAP(6, "Cat Flap"), + PET_WATER(8, "Waterstation"); public final Integer id; public final String name; diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetDrinking.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetDrinking.java new file mode 100644 index 0000000000000..d41d01f0c14c8 --- /dev/null +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetDrinking.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2010-2025 Contributors to the openHAB project + * + * See the NOTICE file(s) distributed with this work for additional + * information. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.openhab.binding.surepetcare.internal.dto; + +import java.time.ZonedDateTime; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.annotations.SerializedName; + +/** + * The {@link SurePetcarePetDrinking} is the Java class used to represent the + * status of a pet. It's used to deserialize JSON API results. + * + * @author Rene Scherer - Initial contribution + * @author Holger Eisold - Added pet feeder status, waterstation + */ +public class SurePetcarePetDrinking { + + public Long tagId; + public Long deviceId; + @SerializedName("change") + public List drinkChange = new ArrayList<>(); + @SerializedName("at") + public ZonedDateTime drinkChangeAt; +} diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetStatus.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetStatus.java index 91eff6a7b9a49..eb8e0ee293015 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetStatus.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/dto/SurePetcarePetStatus.java @@ -23,4 +23,5 @@ public class SurePetcarePetStatus { public SurePetcarePetActivity activity; public SurePetcarePetFeeding feeding; + public SurePetcarePetDrinking drinking; } diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcareDeviceHandler.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcareDeviceHandler.java index 6d6fdf75e0b43..cf6cd6694062b 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcareDeviceHandler.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcareDeviceHandler.java @@ -134,15 +134,17 @@ protected void updateThing() { updateState(DEVICE_CHANNEL_PAIRING_MODE, new StringType(device.status.pairingModeId.toString())); } else { float batVol = device.status.battery; - updateState(DEVICE_CHANNEL_BATTERY_VOLTAGE, new DecimalType(batVol)); - updateState(DEVICE_CHANNEL_BATTERY_LEVEL, new DecimalType(Math.min( - (batVol - BATTERY_EMPTY_VOLTAGE) / (BATTERY_FULL_VOLTAGE - BATTERY_EMPTY_VOLTAGE) * 100.0f, - 100.0f))); + updateState(DEVICE_CHANNEL_BATTERY_VOLTAGE, new QuantityType<>(batVol, Units.VOLT)); + updateState(DEVICE_CHANNEL_BATTERY_LEVEL, + new QuantityType<>( + Math.min((batVol - BATTERY_EMPTY_VOLTAGE) + / (BATTERY_FULL_VOLTAGE - BATTERY_EMPTY_VOLTAGE) * 100.0f, 100.0f), + Units.PERCENT)); updateState(DEVICE_CHANNEL_LOW_BATTERY, OnOffType.from(batVol < LOW_BATTERY_THRESHOLD)); updateState(DEVICE_CHANNEL_DEVICE_RSSI, - QuantityType.valueOf(device.status.signal.deviceRssi, Units.DECIBEL_MILLIWATTS)); + new QuantityType<>(device.status.signal.deviceRssi, Units.DECIBEL_MILLIWATTS)); updateState(DEVICE_CHANNEL_HUB_RSSI, - QuantityType.valueOf(device.status.signal.hubRssi, Units.DECIBEL_MILLIWATTS)); + new QuantityType<>(device.status.signal.hubRssi, Units.DECIBEL_MILLIWATTS)); if (thing.getThingTypeUID().equals(THING_TYPE_FLAP_DEVICE)) { updateThingCurfews(device); @@ -175,6 +177,8 @@ protected void updateThing() { new StringType(device.control.lid.closeDelayId.toString())); updateState(DEVICE_CHANNEL_BOWLS_TRAINING_MODE, new StringType(device.control.trainingModeId.toString())); + } else if (thing.getThingTypeUID().equals(THING_TYPE_WATER_DEVICE)) { + // TODO } else { logger.warn("Unknown product type for device {}", thing.getUID().getAsString()); } diff --git a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java index f23de631a926c..776895d21584c 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java +++ b/bundles/org.openhab.binding.surepetcare/src/main/java/org/openhab/binding/surepetcare/internal/handler/SurePetcarePetHandler.java @@ -26,6 +26,7 @@ import org.openhab.binding.surepetcare.internal.dto.SurePetcareHousehold; import org.openhab.binding.surepetcare.internal.dto.SurePetcarePet; import org.openhab.binding.surepetcare.internal.dto.SurePetcarePetActivity; +import org.openhab.binding.surepetcare.internal.dto.SurePetcarePetDrinking; import org.openhab.binding.surepetcare.internal.dto.SurePetcarePetFeeding; import org.openhab.binding.surepetcare.internal.dto.SurePetcareTag; import org.openhab.core.cache.ByteArrayFileCache; @@ -35,7 +36,9 @@ import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.RawType; import org.openhab.core.library.types.StringType; +import org.openhab.core.library.unit.MetricPrefix; import org.openhab.core.library.unit.SIUnits; +import org.openhab.core.library.unit.Units; import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.Thing; import org.openhab.core.types.Command; @@ -211,6 +214,16 @@ protected void updateThing() { updateState(PET_CHANNEL_FEEDER_LASTFEEDING, new DateTimeType(feeding.feedChangeAt)); } } + SurePetcarePetDrinking drinking = pet.status.drinking; + if (drinking != null) { + SurePetcareDevice device = petcareAPI.getDevice(drinking.deviceId.toString()); + if (device != null) { + updateState(PET_CHANNEL_WATER_DEVICE, new StringType(device.name)); + updateState(PET_CHANNEL_WATER_LAST_CHANGE, + new QuantityType<>(drinking.drinkChange.get(0), MetricPrefix.MILLI(Units.LITRE))); + updateState(PET_CHANNEL_WATER_LASTDRINKING, new DateTimeType(drinking.drinkChangeAt)); + } + } } else { logger.debug("Trying to update unknown pet: {}", thing.getUID().getId()); } diff --git a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/addon/addon.xml b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/addon/addon.xml index ef2ed5db1190d..a7690105c000a 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/addon/addon.xml +++ b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/addon/addon.xml @@ -5,7 +5,7 @@ binding Sure Petcare Binding - This binding interacts with the Sure Petcare Connect range of cat flaps and feeders + This binding interacts with the Sure Petcare Connect range of pet/cat flaps, feeders and waterstations cloud diff --git a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare.properties b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare.properties index fdf0ef955025b..1574242c0c542 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare.properties +++ b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare.properties @@ -1,5 +1,5 @@ addon.surepetcare.name = Sure Petcare Binding -addon.surepetcare.description = This binding interacts with the Sure Petcare Connect range of cat/pet flaps and feeders +addon.surepetcare.description = This binding interacts with the Sure Petcare Connect range of cat/pet flaps, feeders and waterstations # bridge-types thing-type.surepetcare.bridge.label = Sure Petcare API Bridge @@ -31,6 +31,9 @@ thing-type.surepetcare.flapDevice.description = A Sure Petcare cat or pet flap d thing-type.surepetcare.feederDevice.label = Sure Petcare Pet Feeder thing-type.surepetcare.feederDevice.description = A Sure Petcare pet feeder device. +thing-type.surepetcare.waterDevice.label = Sure Petcare Pet Waterstation +thing-type.surepetcare.waterDevice.description = A Sure Petcare pet waterstation device. + thing-type.surepetcare.pet.label = Sure Petcare Pet thing-type.surepetcare.pet.description = A Sure Petcare pet. @@ -51,12 +54,13 @@ channel-type.surepetcare.timezoneIdType.label = Timezone ID channel-type.surepetcare.timezoneIdType.description = The identifier of the timezone. channel-type.surepetcare.productType.label = Product Type -channel-type.surepetcare.productType.description = The type of product this device represents. (0=Unknown, 1=Hub, 3=Pet Flap, 4=Feeder, 6=Cat Flap) +channel-type.surepetcare.productType.description = The type of product this device represents. (0=Unknown, 1=Hub, 3=Pet Flap, 4=Feeder, 6=Cat Flap, 8=Waterstation) channel-type.surepetcare.productType.state.option.0 = Unknown channel-type.surepetcare.productType.state.option.1 = Hub channel-type.surepetcare.productType.state.option.3 = Pet Flap channel-type.surepetcare.productType.state.option.4 = Pet Feeder channel-type.surepetcare.productType.state.option.6 = Cat Flap +channel-type.surepetcare.productType.state.option.8 = Waterstation channel-type.surepetcare.shareCodeType.label = Share Code channel-type.surepetcare.shareCodeType.description = A unique code provided by Sure Petcare to access photos of pets. @@ -195,6 +199,15 @@ channel-type.surepetcare.feederLastChangeLeftType.description = The pet feeding channel-type.surepetcare.feederLastChangeRightType.label = Pet Feeding Last Change Right channel-type.surepetcare.feederLastChangeRightType.description = The pet feeding last change right. +channel-type.surepetcare.waterDeviceType.label = Pet Waterstation Device Name +channel-type.surepetcare.waterDeviceType.description = The pet waterstation device name. + +channel-type.surepetcare.waterLastDrinkingType.label = Pet Last Drinking +channel-type.surepetcare.waterLastDrinkingType.description = The last pet drinking. + +channel-type.surepetcare.waterLastChangeType.label = Pet Drinking Last Change +channel-type.surepetcare.waterLastChangeType.description = The pet drinking last change. + channel-type.surepetcare.lockingModeType.label = Locking Mode channel-type.surepetcare.lockingModeType.description = The id of the locking mode the flap is currently set to (e.g. in/out, in only, out only, locked) channel-type.surepetcare.lockingModeType.state.option.0 = Unlocked diff --git a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare_de.properties b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare_de.properties index 9645ec71729cc..de77e2b0dfa74 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare_de.properties +++ b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/i18n/surepetcare_de.properties @@ -13,10 +13,10 @@ thing-type.config.surepetcare.bridge.password.label = Sure Petcare Passwort thing-type.config.surepetcare.bridge.password.description = Sure Petcare Passwort. thing-type.config.surepetcare.bridge.refreshIntervalStatus.label = Aktualisierungsintervall Haustier Status -thing-type.config.surepetcare.bridge.refreshIntervalStatus.description = Intervall zur Abfrage des Haustier Status (in Sekunden) (mind. 300 / standard 36000). +thing-type.config.surepetcare.bridge.refreshIntervalStatus.description = Intervall zur Abfrage des Haustier Status (in Sekunden) (mind. 300 / standard 300). thing-type.config.surepetcare.bridge.refreshIntervalTopology.label = Aktualisierungsintervall Topology -thing-type.config.surepetcare.bridge.refreshIntervalTopology.description = Intervall zur Abfrage der Geräte und Haustier Daten (in Sekunden) (mind. 300 / standard 300). +thing-type.config.surepetcare.bridge.refreshIntervalTopology.description = Intervall zur Abfrage der Geräte und Haustier Daten (in Sekunden) (mind. 300 / standard 36000). # thing-types thing-type.surepetcare.household.label = Sure Petcare Haushalt @@ -31,6 +31,9 @@ thing-type.surepetcare.flapDevice.description = Ein Sure Petcare Gerät (Haustie thing-type.surepetcare.feederDevice.label = Sure Petcare Gerät (Futterautomat) thing-type.surepetcare.feederDevice.description = Sure Petcare Gerät (Futterautomat). +thing-type.surepetcare.waterDevice.label = Sure Petcare Gerät (Felaqua - Wasserstation) +thing-type.surepetcare.waterDevice.description = Sure Petcare Gerät (Felaqua - Wasserstation). + thing-type.surepetcare.pet.label = Sure Petcare Haustier thing-type.surepetcare.pet.description = Ein Sure Petcare Haustier. @@ -51,12 +54,13 @@ channel-type.surepetcare.timezoneIdType.label = Zeitzone ID channel-type.surepetcare.timezoneIdType.description = Zeigt die ID der Zeitzone an. channel-type.surepetcare.productType.label = Produkt Typ -channel-type.surepetcare.productType.description = Zeigt den Produkt Namen an. \#(0\=unbekannt, 1\=Hub, 3\=Haustierklappe, 4\=Futterautomat, 6\=Katzenklappe) +channel-type.surepetcare.productType.description = Zeigt den Produkt Namen an. \#(0\=unbekannt, 1\=Hub, 3\=Haustierklappe, 4\=Futterautomat, 6\=Katzenklappe, 8\=Wasserstation) channel-type.surepetcare.productType.state.option.0 = unbekannt channel-type.surepetcare.productType.state.option.1 = Hub channel-type.surepetcare.productType.state.option.3 = Haustierklappe channel-type.surepetcare.productType.state.option.4 = Futterautomat channel-type.surepetcare.productType.state.option.6 = Katzenklappe +channel-type.surepetcare.productType.state.option.8 = Wasserstation channel-type.surepetcare.shareCodeType.label = Share Code channel-type.surepetcare.shareCodeType.description = A unique code provided by Sure Petcare to access photos of pets @@ -195,6 +199,15 @@ channel-type.surepetcare.feederLastChangeLeftType.description = Die letzte Futte channel-type.surepetcare.feederLastChangeRightType.label = Letzte Futteraufnahme Änderung (Rechts) channel-type.surepetcare.feederLastChangeRightType.description = Die letzte Futteraufnahme Änderung (rechts). +channel-type.surepetcare.waterDeviceType.label = Wasserstation Name +channel-type.surepetcare.waterDeviceType.description = Der Name der Wasserstation. + +channel-type.surepetcare.waterLastDrinkingType.label = Letzte Wasseraufnahme +channel-type.surepetcare.waterLastDrinkingType.description = Die letzte Wasseraufnahme. + +channel-type.surepetcare.waterLastChangeType.label = Letzte Wasseraufnahme Änderung +channel-type.surepetcare.waterLastChangeType.description = Die letzte Wasseraufnahme Änderung. + channel-type.surepetcare.lockingModeType.label = Sperrmodus channel-type.surepetcare.lockingModeType.description = Zeigt des Sperrmodus des Gerätes an. channel-type.surepetcare.lockingModeType.state.option.0 = Entriegelt diff --git a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/thing/things.xml b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/thing/things.xml index 1cd2ae840f70a..5153d82163561 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/thing/things.xml +++ b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/thing/things.xml @@ -78,7 +78,7 @@ - A Sure Petcare hub device (connects cat flaps, feeders etc. to a network) + A Sure Petcare hub device (connects pet/cat flaps, feeders and waterstations to a network) @@ -192,6 +192,40 @@ id + + + + + + + A Sure Petcare pet waterstation device + + + + + + + + + + + + + + + + + + + + + + + 1 + + id + + @@ -220,6 +254,9 @@ + + + @@ -272,6 +309,7 @@ + @@ -527,6 +565,27 @@ + + String + + The pet waterstation device name + + + + + DateTime + + The last pet drinking + + + + + Number:Volume + + The pet drinking last change + + + String diff --git a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/update/update.xml b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/update/update.xml index 40ededf7cd2db..09ce5d0f8169e 100644 --- a/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/update/update.xml +++ b/bundles/org.openhab.binding.surepetcare/src/main/resources/OH-INF/update/update.xml @@ -14,6 +14,17 @@ + + + + surepetcare:rssiDeviceType + + + surepetcare:rssiHubType + + + + diff --git a/bundles/org.openhab.binding.surepetcare/src/test/java/org/openhab/binding/surepetcare/internal/data/SurePetcareDeviceTest.java b/bundles/org.openhab.binding.surepetcare/src/test/java/org/openhab/binding/surepetcare/internal/data/SurePetcareDeviceTest.java index 85460a4665e65..7990999c2a522 100644 --- a/bundles/org.openhab.binding.surepetcare/src/test/java/org/openhab/binding/surepetcare/internal/data/SurePetcareDeviceTest.java +++ b/bundles/org.openhab.binding.surepetcare/src/test/java/org/openhab/binding/surepetcare/internal/data/SurePetcareDeviceTest.java @@ -25,6 +25,7 @@ * The {@link SurePetcareDeviceTest} class implements unit test case for {@link SurePetcareDevice} * * @author Rene Scherer - Initial contribution + * @author Holger Eisold - Added waterstation */ @NonNullByDefault public class SurePetcareDeviceTest { @@ -122,4 +123,25 @@ public void testJsonDeserializePetFlap() throws ParseException { fail("GSON returned null"); } } + + @Test + public void testJsonDeserializePetWaterstation() throws ParseException { + String testResponse = "{\"id\":123456,\"parent_device_id\":123456,\"product_id\":8,\"household_id\":12345,\"index\":3,\"name\":\"Pet Waterstation\",\"serial_number\":\"A001-0001234\",\"mac_address\":\"A10B00CDE9F5G123\",\"version\":27311,\"created_at\":\"2020-01-01T13:42:45+00:00\",\"updated_at\":\"2020-01-01T13:42:45+00:00\",\"pairing_at\":\"2020-01-01T13:42:45+00:00\",\"last_new_event_at\":\"2020-01-01T13:42:45+00:00\",\"control\":{\"learn_mode\":false},\"status\":{\"battery\":5.72,\"learn_mode\":false,\"signal\":{\"device_rssi\":-84,\"hub_rssi\":-67},\"version\":{\"device\":{\"hardware\":\"1\",\"firmware\":\"213.562\"}},\"online\":true},\"tags\":[{\"id\":123456,\"device_id\":123456,\"index\":1,\"profile\":2,\"version\":1,\"created_at\":\"2020-01-01T13:42:45+00:00\",\"updated_at\":\"2020-01-01T13:42:45+00:00\"},{\"id\":123456,\"device_id\":123456,\"index\":2,\"profile\":2,\"version\":1,\"created_at\":\"2020-01-01T13:42:45+00:00\",\"updated_at\":\"2020-01-01T13:42:45+00:00\"}]}"; + SurePetcareDevice response = SurePetcareConstants.GSON.fromJson(testResponse, SurePetcareDevice.class); + + if (response != null) { + response.getThingProperties(); + assertEquals(Long.valueOf(123456), response.id); + assertEquals(Integer.valueOf(8), response.productId); + assertEquals(Long.valueOf(12345), response.householdId); + assertEquals("Pet Waterstation", response.name); + assertEquals("A001-0001234", response.serialNumber); + assertEquals("A10B00CDE9F5G123", response.macAddress); + assertEquals("1", response.status.version.device.hardware); + assertEquals("213.562", response.status.version.device.firmware); + assertEquals("27311", response.version); + } else { + fail("GSON returned null"); + } + } }