Modyfikacja harmonogramu w głowicy termostatycznej MQTT

Dzień dobry,

Mam głowice TRV602 która przedstawia się jako TS0601.
Głowice połączone są za pomocą zigbee2MQTT i core-mosquitto.
Mam problem z modyfikacją harmonogramu.
Na stronie:
https://www.zigbee2mqtt.io/devices/TS0601_thermostat_1.html#tuya-ts0601_thermostat_1
Jest opisane że pod zigbee2mqtt/FRIENDLY_NAME/set należy opublikować {“undefined”: {“monday_schedule”: VALUE, “tuesday_schedule”: VALUE, “wednesday_schedule”: VALUE, “thursday_schedule”: VALUE, “friday_schedule”: VALUE, “saturday_schedule”: VALUE, “sunday_schedule”: VALUE}}

Podglądnełem co wysyła głowica:

MQTT publish: topic ‘zigbee2mqtt/Termostat Korytarz’, payload ‘{“battery”:92,“boost_heating”:“OFF”,“boost_heating_countdown”:null,“child_lock”:“UNLOCK”,“current_heating_setpoint”:“21.0”,“friday_schedule”:" 4h:0m 15°C, 8h:0m 15°C, 16h:0m 15°C, 22h:0m 15°C “,“heating”:“ON”,“linkquality”:135,“local_temperature”:“17.8”,“local_temperature_calibration”:”-1.6",“max_temperature”:“27.0”,“min_temperature”:“5.0”,“monday_schedule”:" 4h:0m 15°C, 8h:0m 15°C, 16h:0m 15°C, 22h:0m 15°C “,“position”:“100.0”,“preset”:“manual”,“saturday_schedule”:” 9h:0m 15°C, 11h:30m 15°C, 18h:0m 15°C, 22h:0m 15°C “,“sunday_schedule”:” 9h:0m 15°C, 11h:30m 15°C, 18h:0m 15°C, 22h:0m 15°C “,“system_mode”:“auto”,“thursday_schedule”:” 4h:0m 15°C, 8h:0m 15°C, 16h:0m 15°C, 22h:0m 15°C “,“tuesday_schedule”:” 4h:0m 15°C, 8h:0m 15°C, 16h:0m 15°C, 22h:0m 15°C “,“wednesday_schedule”:” 4h:0m 15°C, 8h:0m 15°C, 16h:0m 15°C, 22h:0m 15°C ",“window”:“CLOSED”,“window_detection”:“ON”}’

Na tej podstawie stworzyłem taki wpis:

{“undefined”: {“monday_schedule”: “4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”, “tuesday_schedule”: “4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”, “wednesday_schedule”: “4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”, “thursday_schedule”: “4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”, “friday_schedule”: “4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”, “saturday_schedule”: “7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C”, “sunday_schedule”: “7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C”}}

Następnie opublikowałem go pod: zigbee2mqtt/Termostat Korytarz/set

Niestety po opublikowaniu mam poniższy błąd:

No converter available for ‘undefined’ ({“friday_schedule”:“4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”,“monday_schedule”:“4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”,“saturday_schedule”:“7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C”,“sunday_schedule”:“7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C”,“thursday_schedule”:“4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”,“tuesday_schedule”:“4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”,“wednesday_schedule”:“4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C”})

Przyznam sie że MQTT dopiero rozpoczełem przygodę i nie mam za dużej wiedzy. Nie wiem czy składnia ok i jak prawidłowopowinien wyglądac “ładunek”.

Ja mam zbudowaną funkcje

msg.payload =
{
  "holidays":[
          {"hour":6,"minute":0,"temperature":23},
          {"hour":8,"minute":0,"temperature":24},
          {"hour":11,"minute":30,"temperature":24},
          {"hour":12,"minute":30,"temperature":24},
          {"hour":17,"minute":30,"temperature":25},
          {"hour":22,"minute":0,"temperature":21}
    ]
}
return msg;

i wysyłam na topic: zigbee2mqtt/salon_MOES/set/schedule

w NR wygląda to tak:

Dzięki,

Niestety ta forma wpisu u mnie nie zadziała.
Znając moje szczęście brakuje jakiegoś znaku w formule lub nawiasu i dlatego nie działa.

Sprawdź w mqtt co masz w topicu: ‘zigbee2mqtt/Termostat Korytarz’ i według tego zmodyfikuj funkcję

Tak właśnie zrobiłem i poległem:(

Spróbuj tak:

Ze spacjami jest inny błąd:

Invalid message ‘null’, skipping…

Jeżeli wysyłasz w takiej postaci jak tu publikujesz to tu widać różnicę

{“undefined”   <- Twoje

{"undefined"  <- Orginalne

Dokładnie to wklejam:

{"undefined": {"monday_schedule":" 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "tuesday_schedule":" 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "wednesday_schedule":" 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "thursday_schedule":" 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "friday_schedule":" 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "saturday_schedule":" 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C ", "sunday_schedule":" 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C "}}

co generuje błąd:

No converter available for ‘undefined’ ({“friday_schedule”:“4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C…

Nie wiem czy zauważyłeś, ale @artpc zwracał Ci uwagę na to, że masz jakieś “lewe” cudzysłowy.

“lewe” czyli otwierający i zamykający, "zamiast takich amerykańskich"

W ostatnim poście są akurat OK, ale wcześniej wyglądało to dziwnie.

Tak wygląda formatowanie jak się kodu nie umieści odpowiednio na forum.
Ale już się nauczyłem :slight_smile:

1 polubienie

Topic to publish

zigbee2mqtt/Termostat_P/set/schedule

Payload

{
    "holidays": [{
            "hour": 5,
            "minute": 15,
            "temperature": 21
        }, {
            "hour": 6,
            "minute": 30,
            "temperature": 22
        }, {
            "hour": 11,
            "minute": 45,
            "temperature": 20
        }, {
            "hour": 12,
            "minute": 0,
            "temperature": 20
        }, {
            "hour": 13,
            "minute": 3,
            "temperature": 20
        }, {
            "hour": 14,
            "minute": 4,
            "temperature": 20
        }
    ]
}

{
    "workdays": [{
            "hour": 5,
            "minute": 15,
            "temperature": 21
        }, {
            "hour": 6,
            "minute": 30,
            "temperature": 17
        }, {
            "hour": 11,
            "minute": 45,
            "temperature": 17
        }, {
            "hour": 12,
            "minute": 0,
            "temperature": 17
        }, {
            "hour": 13,
            "minute": 3,
            "temperature": 17
        }, {
            "hour": 14,
            "minute": 4,
            "temperature": 17
        }
    ]
}

Wsady Które napisałeś są do popularnej głowicy: moes
Moja (choć nazwa podobna) całkiem się różni zobacz: https://www.zigbee2mqtt.io/devices/TS0601_thermostat_1.html#tuya-ts0601_thermostat_1
Niby prosto bo na powyższej stronie jest opisane jak wsad powinien wyglądać:

{"undefined": {"monday_schedule": VALUE, "tuesday_schedule": VALUE, "wednesday_schedule": VALUE, "thursday_schedule": VALUE, "friday_schedule": VALUE, "saturday_schedule": VALUE, "sunday_schedule": VALUE}}

Tylko jak sfomułować to co się wpisuje zamiast VALUE, skoro na każdy dzień tygodnia osobno definiuje się po cztery punkty temperatury?

Taki format ?

"monday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",

Sypie errorami :frowning:

Jak wysyłam:

{"monday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "tuesday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "wednesday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "thursday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "friday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "saturday_schedule": " 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C ", "sunday_schedule": " 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C "}

Zwraca:

No converter available for ‘monday_schedule’ (" 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “)
Error 2022-11-23 23:08:03No converter available for ‘tuesday_schedule’ (” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “)
Error 2022-11-23 23:08:03No converter available for ‘wednesday_schedule’ (” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “)
Error 2022-11-23 23:08:03No converter available for ‘thursday_schedule’ (” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “)
Error 2022-11-23 23:08:03No converter available for ‘friday_schedule’ (” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “)
Error 2022-11-23 23:08:03No converter available for ‘saturday_schedule’ (” 7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C “)
Error 2022-11-23 23:08:03No converter available for ‘sunday_schedule’ (” 7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C ")

jeszcze próbowałem:

{"undefined": "monday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "tuesday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "wednesday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "thursday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "friday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "saturday_schedule": " 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C ", "sunday_schedule": " 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C "}

to dostałem:

Invalid message ‘null’, skipping…

najbardziej pasuję mi ta wersja

{"undefined": {"monday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "tuesday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "wednesday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "thursday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "friday_schedule": " 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C ", "saturday_schedule": " 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C ", "sunday_schedule": " 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C "}}

ale też zwraca błąd:

No converter available for ‘undefined’ ({“friday_schedule”:" 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “,“monday_schedule”:” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “,“saturday_schedule”:” 7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C “,“sunday_schedule”:” 7h:45m 21°C, 11h:0m 19°C, 20h:0m 21°C, 22h:0m 19°C “,“thursday_schedule”:” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “,“tuesday_schedule”:” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C “,“wednesday_schedule”:” 4h:0m 21°C, 8h:0m 19°C, 19h:0m 21°C, 22h:0m 19°C "})

Lub ta:

{"undefined": {"monday_schedule": 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C , "tuesday_schedule": 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C , "wednesday_schedule":  4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C , "thursday_schedule": 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C , "friday_schedule": 4h:0m 21°C,  8h:0m 19°C,  19h:0m 21°C,  22h:0m 19°C , "saturday_schedule": 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C , "sunday_schedule": 7h:45m 21°C,  11h:0m 19°C,  20h:0m 21°C,  22h:0m 19°C }}

Ale ta zwraca:

Invalid message ‘null’, skipping…

Heh pomysły mi się kończą :face_with_diagonal_mouth:

{
    "battery": 100,
    "child_lock": "UNLOCK",
    "current_heating_setpoint": "15.0",
    "friday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",
    "heating": "OFF",
    "linkquality": 73,
    "local_temperature": "21.4",
    "max_temperature": "35.0",
    "min_temperature": "5.0",
    "monday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",
    "position": 0,
    "preset": "auto",
    "saturday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",
    "sunday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",
    "thursday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",
    "tuesday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",
    "wednesday_schedule": " 6h:0m 20°C, 12h:0m 15°C, 18h:0m 22°C, 22h:0m 15°C ",
    "window": "CLOSED",
    "window_detection": "OFF"
}

Topic

zigbee2mqtt/Termostat_P/set/schedule

Nie rozumiem :frowning:
a zmienić topic na:

zigbee2mqtt/Termostat_P/set/schedule

po set daj schedule set/schedule

Wydaje mi się że to nie jest oprogramowane. Patrze właśnie na:

I nie ma w kluczu toZigbee metody do ustawiania tych danych. Ale IMHO patrząc na źródła da się to zhakować.

W mojej głowicy zmienia te parametry dla workdays i holidays

zigbee2mqtt/Termostat_P/set/schedule

{
    "workdays": [{
            "hour": 5,
            "minute": 15,
            "temperature": 21
        }, {
            "hour": 6,
            "minute": 30,
            "temperature": 17
        }, {
            "hour": 11,
            "minute": 45,
            "temperature": 17
        }, {
            "hour": 12,
            "minute": 0,
            "temperature": 17
        }, {
            "hour": 13,
            "minute": 3,
            "temperature": 17
        }, {
            "hour": 14,
            "minute": 4,
            "temperature": 17
        }
    ]
}