Closed capitalfuse closed 8 years ago
Hi, thanks for the compliment, I appreciate it. It looks like a bug, you're using Pimatic v0.9?
Thanks for your quick reply. My Pimatic works under below conditions. pimatic version 0.8.104 ---> changed 0.9.8, but still no data. node v4.4.3 npm v2.15.1 Now I will try to tweak the code in mqtt-sensor.coffee, but I am a beginner for coffescript.
https://github.com/hughsk/flat/issues/45 if you're not using JSON in payload, just remove "flatten" out of line 'try flatten JSON.parse data = (message)'. It is strange that you run Pimatic 8 with Node 4. I got an error when I use Node 4 and Pimatic 9 beta.
Thanks for your advice, I will try it.
I installed latest pimatic by following. Stop pimatic service and...
So did I get errors, but pimatic seems to be working with no problem.
---> errors refer to dependencies of plugins installed, need to modify pimatic version(+node and npm version) in package.json in plugin modules.
I adopted the Arduino JSON library. Published the dht22 values by Json decoding. Works great!
I think this MQTT plugin become the core technology for Pimatic. Thanks for plugin designers.
I updated pimatic-mqtt plugin to latest version, my esp-12e connected with dht-22 published only numbers of temp and humid for each topic like the following;
{ "name": "ESP12 with rgb led", "id": "esp12", "class": "MqttSensor", "attributes": [ { "name": "temperature", "topic": "myhome/firstfloor/office/esp12/dht22/temperature", "type": "number", "unit": "°C", "acronym": "DHT-22-Temperature" }, { "name": "humidity", "topic": "myhome/firstfloor/office/esp12/dht22/humidity", "type": "number", "unit": "%", "acronym": "DHT-22-Humidity" } ] },
I checked whether these numbers published precisely on ubuntu terminal by mosquitto_sub command, but pimatic shows no values. (each value is 0). Any hints do you have?
in this file, devices/mqtt-sensor.coffee It seems that below codes don't work?
try data = flatten JSON.parse(message) if typeof data is 'object' then for key, value of data if key == attr.name if attr.type == 'number' if attr.division @emit attr.name, Number("#{value}") / attr.division else @emit attr.name, Number("#{value}") else @emit attr.name, "#{value}"