Comments (6)
Forgot to say: using version 2.1.0
from weewx-mqttsubscribe.
Your json payload is
{
"battery":71,
"humidity":43.77,
"last_seen":"2022-05-18T14:25:08-03:00",
"linkquality":98,
"temperature":21.13,
"voltage":2900
}
MQTTSubscribe attempts to convert all incoming data to float. The easisest, if you don't care about last_seen
is to ignore it.
[[[zigbee2mqtt/Escritorio_-_Temperatura]]]
[[[[message]]]]
type = json
[[[[temperature]]]]
name = inTemp
[[[[last_seen]]]]
ignore = true
Alternately you could keep it as a string
[[[zigbee2mqtt/Escritorio_-_Temperatura]]]
[[[[message]]]]
type = json
[[[[temperature]]]]
name = inTemp
[[[[last_seen]]]]
conversion_type = none
from weewx-mqttsubscribe.
Tks! I will try this tonorrow.
One sugestion is to parse only specified fields from condifuration. I mean, default state would be ignore and just include fields from condiguration.
from weewx-mqttsubscribe.
Agree that if I was starting from scratch, 'opt in' woukd make sense. When I started I wanted everyting in the json and now with MQTTSubscribe 3 years old, I am hesitate to make that kind of breaking change.
If one wants to 'opt in', you could do something like this.
[[[zigbee2mqtt/Escritorio_-_Temperatura]]]
ignore = true
[[[[message]]]]
type = json
[[[[temperature]]]]
name = inTemp
ignore = false
from weewx-mqttsubscribe.
Are you all set?
from weewx-mqttsubscribe.
Closing due to inactivity. Feel free to reopen if necessary.
from weewx-mqttsubscribe.
Related Issues (20)
- Ignore
- Do not run codecov and sonar on pull requests
- expires_after = None is ignored HOT 1
- Unsubscribed Topics HOT 8
- Need to migrate off of nose HOT 2
- Int Values Stored As Floats in DB HOT 29
- Possible problem with rain and contains_total HOT 2
- problem while installing... HOT 4
- problem reading values... HOT 7
- WeeWX crashes because MQTTSubscribe fails network connect on cold start or reboot HOT 3
- expires_after does not always work HOT 3
- MQTT problems cause WeeWX consuming all the CPU HOT 13
- MessageCallbackProvider on_message_json failed with <class 'user.MQTTSubscribe.ConversionError'> HOT 1
- weew mqtt subscribe HOT 70
- Gaps in WeeWx data HOT 26
- Parse more complex json messages HOT 2
- Deprecate [[message_callback]] HOT 4
- Refactor the validate function so that it can used when running under WeeWX HOT 1
- Cleanup WeeWX stubs and mocks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weewx-mqttsubscribe.