Autor Thema: CustomReadings without polling interval  (Gelesen 848 mal)

Offline newb

  • New Member
  • *
  • Beiträge: 10
CustomReadings without polling interval
« am: 03 Januar 2020, 22:23:59 »
Hi I've got a sensor which sends its readings with GET request:

xxx.xxx.xxx.xxx:8380/fhem?cmd=setreading device state xxxx
I've setup CustomReadings device in FHEM, but it polls for readings all the time and gives ERROR. I want this device to be passive and only take readings when the sensor sends the GET request. Is this possible?

Offline xenos1984

  • Full Member
  • ***
  • Beiträge: 194
Antw:CustomReadings without polling interval
« Antwort #1 am: 03 Januar 2020, 23:00:57 »
Why don't you use a dummy device instead of CustomReadings? The dummy does not poll and you can set its readings via telnet or HTTP / FHEMWEB.

Offline newb

  • New Member
  • *
  • Beiträge: 10
Antw:CustomReadings without polling interval
« Antwort #2 am: 04 Januar 2020, 10:09:08 »
Yes, you are right :) It works well with dummy device. Although I'm considering setting it up as MQTT device as well, it seems to me passing the data via mqtt is quicker than GET request (with ssl enabled). Do you have any experience? The goal is to save as much battery as possible.

Offline rudolfkoenig

  • Administrator
  • Hero Member
  • *****
  • Beiträge: 22818
Antw:CustomReadings without polling interval
« Antwort #3 am: 04 Januar 2020, 11:39:09 »
Zitat
it seems to me passing the data via mqtt is quicker than GET request (with ssl enabled). Do you have any experience?
That will heavily depend on the implementation of the client.
In theory MQTT is more efficient then HTTP for transmitting small amounts of data, but knowing FHEM internals you can build an HTTP solution which is equally efficient.
If you do not want to research a lot, go for MQTT.