Comments (3)
I think this is actually a documentation error on my part. In the docs it says to use type: 'string'
, but it should be type: 'str'
. I think this is causing the friendly topic publish function to end up with a null value for those two keys since it doesn't have a matching type. Could you change those two lines in your template for keys 3 & 4 so it uses 'str' instead of 'string' and try again? I'll go fix the docs.
from tuya-mqtt.
Yes, this works. Now I get:
tuya/aiibot_air_purifier/command get-states
tuya/aiibot_air_purifier/power_state ON
tuya/aiibot_air_purifier/pm25_state 9
tuya/aiibot_air_purifier/mode_state auto
tuya/aiibot_air_purifier/speed_state 1
tuya/aiibot_air_purifier/dps/state {"1":true,"2":9,"3":"auto","4":"1","7":false,"19":"0","22":"1"}
tuya/aiibot_air_purifier/dps/1/state true
tuya/aiibot_air_purifier/dps/2/state 9
tuya/aiibot_air_purifier/dps/3/state auto
tuya/aiibot_air_purifier/dps/4/state 1
tuya/aiibot_air_purifier/dps/7/state false
tuya/aiibot_air_purifier/dps/19/state 0
tuya/aiibot_air_purifier/dps/22/state 1
Thanks a lot!
from tuya-mqtt.
Good to know it works. I've updated the docs so I'm going to go ahead and close this for now.
I'm realizing that I can probably just automatically detect the type for the state and DPS key topics since I know if it's a bool, number or string based on the JSON data type. I'll try to implement some automatic handling of this in the future to make this setup even easier.
from tuya-mqtt.
Related Issues (20)
- tuya-mqtt correctly publishes state, but fails on command messages HOT 5
- Empty Data Returned After Publishing get-states HOT 3
- TypeError: Cannot set property 'updated' of undefined HOT 9
- Problem installing on Synology RS914 HOT 32
- Home Assistant integration how? HOT 2
- tuya-mqtt publishes states only when app is opened. HOT 22
- What mqtt broker HOT 3
- Disconnected from device and never connects again ... HOT 6
- Samples for nodejs script HOT 9
- New Maintainer Needed HOT 4
- Not sure when you went into Maintenance mode HOT 3
- Command Syntax for friendly topics HOT 3
- Setting switch state of a smart switch (custom template) HOT 11
- zombe state reconnecting issue? HOT 1
- Switch w/ Energy: DPS values reported only once at tuya-mqtt startup HOT 3
- Sudenly wrong responses from tuya device HOT 1
- tuya-mqtt not working (OpenHab) HOT 7
- Tuya bulb stopped working from tuya-cli, tuja-mqtt HOT 9
- Devices behind zigbee gateway available with tuya-cli but not tuya-mqtt HOT 1
- Different names after service restart HOT 9
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 tuya-mqtt.