Code Monkey home page Code Monkey logo

Comments (10)

joba-1 avatar joba-1 commented on May 30, 2024

Hi,
nice to know the plugin generally works for you.
Two remarks: 1) tasmoticz only does the detection of tasmota devices and creates domoticz devices from it. It has nothing to do with the operation of the switch. It could be you would have problems detecting new devices. Have you checked this?
2) There seems to be a json message arriving via mqtt from the updated tasmota devices that my plugin does not properly cope with. It will help to see mqtt messages that are sent from tasmota at the time the error message appears.

from tasmoticz.

megamarco833 avatar megamarco833 commented on May 30, 2024

hi discover something,
https://tasmota.github.io/docs/PCF8574/#pcf8574-in-sensor-message

PCF8574 in SENSOR message~

Enabling USE_PCF8574_SENSOR adds a PCF8574-xx field into the JSON payload of the tele/topic/SENSOR message. The form of the message is:
13:19:07.459 MQT: tele/tasmota_156/SENSOR = {"Time":"2021-05-12T13:19:07","PCF8574-1":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":1,"D5":1,"D6":1,"D7":1,"PCF8574-2":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":0,"D5":1,"D6":1,"D7":1}}

i set in tasmoticz:
image

i try to compile again the firmware but this time inside my_user_config.h i not enable :
#define USE_PCF8574_SENSOR // enable PCF8574 inputs and outputs in SENSOR message

in this case i do not receive the errors.

But maybe could be fixed the usage of tasmota "sensor" option inside tasmoticz?
could be useful to listen also at "tele/%topic%/SENSOR" to menage also this new implementation?

from tasmoticz.

joba-1 avatar joba-1 commented on May 30, 2024

I suspect a world record here: fastest time in delivering requested log output :)

The SENSOR message is the culprit - it actually is not valid JSON. A curly brace after the first sensor data is missing.
I'm sure the people over at tasmota can help you with that.

from tasmoticz.

megamarco833 avatar megamarco833 commented on May 30, 2024

I suspect a world record here: fastest time in delivering requested log output :)

ahahah no no it is just lucky that we was write simultaneously i suspect :D

The SENSOR message is the culprit - it actually is not valid JSON. A curly brace after the first sensor data is missing.
I'm sure the people over at tasmota can help you with that.

mmm sorry where is the curly brace missing!?
13:19:07.459 MQT: tele/tasmota_156/SENSOR = {"Time":"2021-05-12T13:19:07","PCF8574-1":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":1,"D5":1,"D6":1,"D7":1,"PCF8574-2":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":0,"D5":1,"D6":1,"D7":1}}

thanks

from tasmoticz.

joba-1 avatar joba-1 commented on May 30, 2024

I suspect a world record here: fastest time in delivering requested log output :)

ahahah no no it is just lucky that we was write simultaneously i suspect :D
:)

mmm sorry where is the curly brace missing!?
13:19:07.459 MQT: tele/tasmota_156/SENSOR = {"Time":"2021-05-12T13:19:07","PCF8574-1":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":1,"D5":1,"D6":1,"D7":1###right here###,"PCF8574-2":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":0,"D5":1,"D6":1,"D7":1}}

thanks

from tasmoticz.

joba-1 avatar joba-1 commented on May 30, 2024

I guess, this is how it should look like:

echo '{"Time":"2021-05-12T13:19:07","PCF8574-1":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":1,"D5":1,"D6":1,"D7":1},"PCF8574-2":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":0,"D5":1,"D6":1,"D7":1}}' | python -m json.tool
{
    "Time": "2021-05-12T13:19:07",
    "PCF8574-1": {
        "D0": 1,
        "D1": 1,
        "D2": 1,
        "D3": 1,
        "D4": 1,
        "D5": 1,
        "D6": 1,
        "D7": 1
    },
    "PCF8574-2": {
        "D0": 1,
        "D1": 1,
        "D2": 1,
        "D3": 1,
        "D4": 0,
        "D5": 1,
        "D6": 1,
        "D7": 1
    }
}

from tasmoticz.

megamarco833 avatar megamarco833 commented on May 30, 2024

sorry for that, now i perfectly understand, and you are fully right!
i will try to talk with tasmota.

do you think that ones it will be fixed could be useful for your plugin use the "sensor" json?

from tasmoticz.

megamarco833 avatar megamarco833 commented on May 30, 2024

hi, now the json is fixed:

previous (wrong)
13:19:07.459 MQT: tele/tasmota_156/SENSOR = {"Time":"2021-05-12T13:19:07","PCF8574-1":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":1,"D5":1,"D6":1,"D7":1,"PCF8574-2":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":0,"D5":1,"D6":1,"D7":1}}

new(correct)
18:41:59.537 MQT: tele/tasmota_156/SENSOR = {"Time":"2021-05-12T18:41:59","PCF8574-1":{"D0":1,"D1":0,"D2":1,"D3":1,"D4":1,"D5":1,"D6":1,"D7":1},"PCF8574-2":{"D0":1,"D1":1,"D2":1,"D3":1,"D4":1,"D5":1,"D6":1,"D7":1}}}

thanks for help me on recognize the error.

i tested with tasmoticz plugin and now it works without any issue.


i take the take advantage of this topic and json issue to ask, if it's possible and feasible to look at json of shutter in tasmota to menage in domoticz.

it could be great!!!!

inside json there is the percentage and we can link domoticz blinde with percentage to firmware with tasmota.
here an example of json from tasmota for blind:

19:04:12.913 MQT: stat/tasmota_blind_new/RESULT = {"POWER2":"ON"}
19:04:12.917 MQT: stat/tasmota_blind_new/POWER2 = ON
19:04:12.921 MQT: stat/tasmota_blind_new/RESULT = {"ShutterPosition1":37}
19:04:12.980 MQT: stat/tasmota_blind_new/RESULT = {"Shutter1":{"Position":57,"Direction":-1,"Target":37}}
19:04:13.724 MQT: stat/tasmota_blind_new/RESULT = {"Shutter1":{"Position":52,"Direction":-1,"Target":37},"Shutter2":{"Position":27,"Direction":0,"Target":27}}
19:04:14.728 MQT: stat/tasmota_blind_new/RESULT = {"Shutter1":{"Position":45,"Direction":-1,"Target":37},"Shutter2":{"Position":27,"Direction":0,"Target":27}}
19:04:15.758 MQT: stat/tasmota_blind_new/RESULT = {"Shutter1":{"Position":38,"Direction":-1,"Target":37},"Shutter2":{"Position":27,"Direction":0,"Target":27}}
19:04:15.951 MQT: stat/tasmota_blind_new/RESULT = {"POWER2":"OFF"}
19:04:15.958 MQT: stat/tasmota_blind_new/POWER2 = OFF
19:04:16.466 MQT: stat/tasmota_blind_new/SHUTTER1 = 37
19:04:16.473 MQT: stat/tasmota_blind_new/RESULT = {"Shutter1":{"Position":37,"Direction":0,"Target":37}}

what do you think?
tasmoticz could look at:
19:04:16.466 MQT: stat/tasmota_blind_new/SHUTTER1 = 37
stat/%topic%/SHUTTER1 = 37 => shutter1 is at 37% to update domoticz when command is issued by tasmota

and when the command is send by domoticz, :
nValue=0-->total Closed
nValue=1-->>total Opened
nValue=2-->>level=sValue

so tasmoticz should send for set percentage (level):
cmnd/<topic>/shutterposition <svalue1>
svalue1 contain the percentage of positioning

when total close or total open domoticz use (looking at nValue):
cmnd/<topic>/shutterOpen <number of blind to control>
cmnd/<topic>/shutterClose <number of blind to control>

could be used to expand the functionality of tasmoticz?

from tasmoticz.

megamarco833 avatar megamarco833 commented on May 30, 2024

ciao @joba-1 i tested the new release of tasmota, and now they fixed the output json and it's working with your plugin tasmoticz :)
thanks for highlight the mistake inside tasmota :)

did you get the chance to have a look at second part of my post?
can you look at json response of blind state?
can tasmoticz plugin menage also this ? :)

from tasmoticz.

joba-1 avatar joba-1 commented on May 30, 2024

good to know that it works now.

Adding shutter/blinds support is definitely possible, but my time schedule does not allow me to add new features - especially if I don't have devices to test it with (and since some time already). So if there is a PR I‘ll certainly evaluate it but other than that I can just fix bugs and add new sensor types occasionally.

from tasmoticz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.