Hi there!
Has anyone done some work to export/publish some of the pimatic data to Thingspeak (or other data-gathering IoT services)? Ideally one could set up which variables are exported - I don’t want all the data to be published.
Thanks
Martin
Publish Data to Thingspeak
Hi there!
Has anyone done some work to export/publish some of the pimatic data to Thingspeak (or other data-gathering IoT services)? Ideally one could set up which variables are exported - I don’t want all the data to be published.
Thanks
Martin
@xwq Hi Martin,
I have started to look into ThinkSpeak, recently. Regarding ThinkSpeak I am planning to provide a plugin or some “glue code” for Pimatic. It should fairly straightforward as Pimatic already supports MQTT (see pimatic-mqtt developed by @wutu). The only thing missing is some code to establish a “ThinkSpeak Channel” (afaics, a HTTP/HTTPS connection used to passthru MQTT messages) and to configure the message passing (subscriptions). I was think of this as a kind of MQTT Bridge - may be something along the lines of the mqtt-bridge project.
Motivation: Mainly, I got inspired by tinkering project like the following project. My idea is to build a variation of this using ESPeasy for the sensor/actuator device and let Pimatic mediate between between the local MQTT domain and the ThingSpeak cloud. At a later stage I also wanted to look into Azure.
EDIT: Another thing I wanted to look into is CloudMQTT, which is a hosted, distributed MQTT Broker Service, as this may serve the required bridging functionality.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Bridging for Mosquitto and AWS IoT is a nice example.
For ThingSpeak can use https://github.com/jpmens/mqttwarn#thingspeak for now. Ideal if you just want a few variables.
Working on a feature that exports all device attributes of Pimatic to MQTT broker.
@mqttclient.on("connect", () =>
@framework.on('deviceAttributeChanged', (attrEvent) =>
_name = attrEvent.attributeName.toLowerCase().replace(' ', '_')
_id = attrEvent.device.config.id.toLowerCase()
_value = attrEvent.value.toString()
_topic = ('pimatic/' + _id + '/' + _name)
console.log _topic
console.log _value
@mqttclient.publish(_topic, _value)
)
)
Pimatic = Smart Home
Thanks for your replies - looks promising!
I already thought about using an MQTT broker as an intermediary but haven’t tried so far. Please let me know of any further developments in this direction.