Termostat w supla-device for linux

User avatar
klew
Posts: 10691
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław

Post

Robert Błaszczak wrote: Mon Nov 20, 2023 11:27 am A może zamiast

Code: Select all

main_thermometer_channel_no
zaczytywać wartość temperatury bezpośrednio z pliku tekstowego. Np.

Code: Select all

main_thermometer_file
I tak trzeba dodać kanał termometru i jakoś go skonfigurować. Odczyt z pliku też może być różny (inny wiersz tekstu, format json, etc).
W obecnej konfiguracji ustawia się osobno termometr i osobno termostat.
User avatar
shimano73
Posts: 2071
Joined: Sun Feb 28, 2016 12:27 pm
Location: Orzesze

Post

Utworzyłem termostat w nowej usłudze
Nowy plik yaml :

Code: Select all

name: Thermostat 4 linux
log_level: debug
state_files_path: "/home/dariusz/Thermostat"
security_level: 2 # disable certyficate verification

supla:
  server:  beta-cloud.supla.org
  mail:  dariuszjszymanski@gmail.com

channels:
  - type: ThermHygroMeterParsed
    source:
      type: File
      file: "/home/dariusz/MiTemperature2/A4:C1:38:3F:9C:2C.txt"
      expiration_time_sec: 120
    parser:
      type: Simple
      refresh_time_ms: 5000
    temperature: 0
    humidity: 1
    multiplier_temp: 1
    multiplier_humi: 1
    battery_level: 2

# Termostaty
  - type: Hvac
    cmd_on: "echo 0 > /sys/class/gpio/gpio20/value"
    cmd_off: "echo 1 > /sys/class/gpio/gpio20/value"
    # cmd_on_secondary:
    # cmd_off_secondary:
    main_thermometer_channel_no: 0
    aux_thermometer_channel_no: 0
    default_function: heat


Zauwazłem iż ten "aux_thermometer_channel_no" musi być przypisany bo jeśli jest za remowany / jego brak, to usługa się crashuje

Code: Select all

dariusz@attic:~/Thermostat $ sudo systemctl status supla-therm.service
● supla-therm.service - Supla Thermostat
     Loaded: loaded (/etc/systemd/system/supla-therm.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-11-21 08:40:05 CET; 3s ago
    Process: 27177 ExecStart=/home/dariusz/supla-device/extras/examples/linux/build/supla-device-linux -c /etc/supla-therm.yaml (code=exited, status=1/FAILU>
   Main PID: 27177 (code=exited, status=1/FAILURE)
        CPU: 51ms

Nov 21 08:40:05 attic supla-device-linux[27177]: INFO[1700552405.1700552405] Read write config: initializing storage from file...
Nov 21 08:40:05 attic supla-device-linux[27177]: INFO[1700552405.1700552405]  *** Starting supla-device ***
Nov 21 08:40:05 attic supla-device-linux[27177]: INFO[1700552405.1700552405] Using config file /etc/supla-therm.yaml
Nov 21 08:40:05 attic supla-device-linux[27177]: INFO[1700552405.1700552405] Channel[0] config: adding ThermHygroMeterParsed
Nov 21 08:40:05 attic supla-device-linux[27177]: INFO[1700552405.1700552405] Channel[1] config: adding Hvac
Nov 21 08:40:05 attic supla-device-linux[27177]: ERR[1700552405.1700552405] Channel[1] config: missing mandatory "aux_thermometer_channel_no" parameter
Nov 21 08:40:05 attic supla-device-linux[27177]: ERR[1700552405.1700552405] Config: parsing channel 1 failed
Nov 21 08:40:05 attic supla-device-linux[27177]: ERR[1700552405.1700552405] Loading channels failed. Exit
Nov 21 08:40:05 attic systemd[1]: supla-therm.service: Main process exited, code=exited, status=1/FAILURE
Nov 21 08:40:05 attic systemd[1]: supla-therm.service: Failed with result 'exit-code'.
lines 1-17/17 (END)

W działaniu termostatu na razie bez zmian ale ikonka wskazuje że grzać :)
Mój GKW ma ID22431 na beta-cloud
W elektronice jak nie wiadomo o co chodzi to zwykle chodzi o zasilanie

Wezmę udział w Supla Offline Party 2024 :)
User avatar
shimano73
Posts: 2071
Joined: Sun Feb 28, 2016 12:27 pm
Location: Orzesze

Post

klew wrote: Mon Nov 20, 2023 11:51 am
Chciałem się przypomnieć , zaktualizowałem SD4L do 23.12. usunąłem urządzenie z beta-cloud'a i ponownie się zarejestrowało.
Niestety termostat nadal nie funkcjonuje :(
W elektronice jak nie wiadomo o co chodzi to zwykle chodzi o zasilanie

Wezmę udział w Supla Offline Party 2024 :)
User avatar
klew
Posts: 10691
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław

Post

shimano73 wrote: Wed Dec 06, 2023 1:14 pm
klew wrote: Mon Nov 20, 2023 11:51 am
Chciałem się przypomnieć , zaktualizowałem SD4L do 23.12. usunąłem urządzenie z beta-cloud'a i ponownie się zarejestrowało.
Niestety termostat nadal nie funkcjonuje :(
Wrzuciłem przed chwilą poprawkę, aby ten "aux" nie był wymagany. Także możesz usunąć te linijki z yamla.
Natomiast gdy parametr jest podany, a chcesz nie używać "auxa" to trzeba podać numer kanału termostatu, a nie głównego termometru.
Może dlatego to u Ciebie nie działało.

Return to “Supla-device dla Linuxa (sd4linux)”