Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KNX read request #3165

Closed
ss83 opened this issue Jul 8, 2018 · 26 comments
Closed

KNX read request #3165

ss83 opened this issue Jul 8, 2018 · 26 comments

Comments

@ss83
Copy link

ss83 commented Jul 8, 2018

I'm a little bit struggeling with the KNX function. In the Wiki it says that for rules Tasmota can "receive a KNX read request" which would be done with a rule triggered by "KNX RX 1" for example.

Some KNX device like logic engines or visualisations perform some sort of init scan when they start up to get the actual state on the other devices. In this case they send out a read request and don't expect a normale write as answer.
From the knx lib of envy I know that there are two ways to write data to the knx bus. The first one is something like "knx.write1Bit" which results in a message on the bus with the value or state. The second one is "knx.answer1Bit" which will be recognized by the knx devices on the bus as a reponse to a read request. The normale write is not recognized for this, even if it is triggered as "KNX TX 1" within the rule.

So it would be fine to have not only the "KNX TX 1" for sensding to be knx bus but also a subject for an answer.

I think the most comfortable way to realize that would be to have a checkbox beside the defined group adresses to enable theses adresse to answer on an read request ( knx.answer1Bit ). I think this would only be needed on the sending group adresses.

Regards
Sven

@ascillato
Copy link
Contributor

Hi,

Tasmota will answer a KNX read request only for relays, temperature, humidity, etc.

What are you trying to do that requires an extra answer?

@ss83
Copy link
Author

ss83 commented Jul 9, 2018

Hi,

the read request ist performed on the following 3 group adresses:

Ausgang 1     -->     1/4/1
Ausgang 2     -->     1/4/11
Ausgang 3     -->     2/4/1

On these group adresses Tasmota sends out the state of the relays. According to your explaination I would expect an answer to the init scan / read request on theses adresses. But this does not happen.

here is a Picture of my configuration:
sonoff 2 config
These adresses are linked to a relay / Output (German: Ausgang)
Is this configuration correct?

Regards
Sven

@jeylites
Copy link

jeylites commented Jul 9, 2018

@ss83

Don't know if it's intentional or an error but you have the last digit on Send and Receive setup differently.

screen shot 2018-07-09 at 2 12 43 pm

@ss83
Copy link
Author

ss83 commented Jul 9, 2018

Hi jeylites,

that is intend to be so. In the visualisation you would like to have a clear state and do not want to react just on the switching signal. For example I could send out a "1" on 1/4/0 to relay1 and when the message reaches the device I get a "1" on the 1/4/1 back. If the message on 1/4/0 does not reach the device I do not get the "1" on 1/4/1 but the visualisation would think that the relay is on on since it takes just the "switching Signal". Therefore a different adress between "Switching Signal" and "State Signal" is wanted on the bus for clarify.

Regards
Sven

@jeylites
Copy link

jeylites commented Jul 9, 2018

@ss83

right, I think I understand now what you are trying to do. It seems similar to my setup. If Output 1 on Device 1 is turn ON, Output 1 on Device 2 does as well. Vice-versa....

Device 1
screen shot 2018-07-09 at 4 15 49 pm

Device 2
screen shot 2018-07-09 at 4 16 00 pm

@jeylites
Copy link

jeylites commented Jul 9, 2018

@ss83

In a simpler form, there needs to be an Output, Output Toggle and Button, Output . See the example below.

39795604-c48730ae-5383-11e8-9988-d2978aa48160

39795610-cd404dd4-5383-11e8-9377-d666aae40c1c

@ss83
Copy link
Author

ss83 commented Jul 9, 2018

Hi,

my Setup consists of a logic engine which also provides the visualisation (EDOMI) and one Sonoff 4CH Pro device.
The command to Switch a relay is send out by the logic engine, here I do not Need to toggle since the logic engine sends out a 1 or 0. The logic consist of some timers etc.
From the Sonoff device I Need the Feedback about the state to be sure that the command has arrived and the relay took the desired state.

For start up the logic engine / visualisation I Need the actual state of the device because it can occure that the logic engine restarts and looses the knowledge about the last state. And here my Problem kicks in: I don't get the answer to the read request on the defined "Data to Send to Group Addresses".

@ascillato
Copy link
Contributor

ascillato commented Jul 9, 2018 via email

@ss83
Copy link
Author

ss83 commented Jul 10, 2018

Ok understand.

I will try to solve this by a rule.

@ascillato2
Copy link
Collaborator

ascillato2 commented Jul 10, 2018

Hi,

You dont need a rule for a read request.

If you want to know the state of your relay, put your relay at the GROUP ADDRESSES TO RECEIVE DATA FROM.

That list will receive the write command (to change the state of the relay) AND ALSO the read requests that will not change the state of the relay and will respond the actual state.

You will need to use the same address for read and for write.

@ss83
Copy link
Author

ss83 commented Jul 10, 2018

Hi Ascillato2,

yes this I know, but I do not need the answer on this group address (in my example 1/4/0 for switching the relay), I need it on the group address for the state of the relay (in my example 1/4/1).

That is exactly the problem with this constellation: Group address for switching and address for state are different.

Regards Sven

@ascillato
Copy link
Contributor

ascillato commented Jul 10, 2018 via email

@ascillato
Copy link
Contributor

You can have in the "group address to read data from" 2 different address for the same thing like:

1/4/0 -> Output 1
1/4/1 -> Output 1

So in your KNX network, you will use 1/4/0 for setting the state of the Output 1 and 1/4/1 for reading the actual state of the same Output 1

@ascillato
Copy link
Contributor

Hi,

Try as the following image please:

image

I think, this configuration should work as you expected at the beginning.

@ascillato2
Copy link
Collaborator

Hi @ss83

Have you managed to solve your issue?

@ascillato2
Copy link
Collaborator

Hi

Seems that your question has been addressed. Closing this issue. Please, reopen if needed. Thanks.

@ss83
Copy link
Author

ss83 commented Jul 16, 2018

Hi ascillato2,

sorry for late answer, was out with the kids for some days.
With this settings it is working like I need it.

Unfortunatelly the Tasmota is missing some commands, but this was the same with my own sketch using the envy library. I think this is more or less a problem on the knx-wifi-connection itself.

Thanks for your help!

Regards
Sven

@ascillato
Copy link
Contributor

Hi,

sorry for late answer

No need to apologize. I was asking just for follow up the issue. It is all ok.

With this settings it is working like I need it.

Great! 👍

Unfortunatelly the Tasmota is missing some commands, but this was the same with my own sketch using the envy library. I think this is more or less a problem on the knx-wifi-connection itself.

Yes, exactly. Multicast relays on your router configuration. For improve that, try:

  • change the snoop IGMP config
  • IGMP protocol to v3
  • connect your Sonoff directly to your main router.
  • not using extender nor access points

Hope this helps.

Thanks

@ascillato
Copy link
Contributor

Unfortunatelly the Tasmota is missing some commands, but this was the same with my own sketch using the envy library. I think this is more or less a problem on the knx-wifi-connection itself.

Tasmota now has a KNX Enhanced Communication option that solves that issue for several brands of routers.

@Winni66
Copy link

Winni66 commented Mar 5, 2020

Sorry for using this old issue, but it seems, that Tasmota has still the same behaviour like mentioned here. KNX devices have the possibility to declare which GAs are responding to read requests (read flag in ETS).
Normally these are the sending GAs, because remote systems should be able to request the actual status of a device (in addition to periodic or delta information coming from the device itself).
The receiving GAs will mostly not answer to a read request. In Tasmota it seems to be the other way round.
What about a flag to define the behaviour to give all people the chance to select how they want to work?

@ascillato
Copy link
Contributor

Hi, the Tasmota knx driver and knx library is small and optimized for small RAM and flash usage. For your usecase, Tasmota allows you to have a group address you want to read the state by adding it to the "group address to read data from"

You can have in the "group address to read data from" 2 different address for the same thing like:

1/4/0 -> Output 1
1/4/1 -> Output 1

So in your KNX network, you will use 1/4/0 for setting the state of the Output 1 and 1/4/1 for reading the actual state of the same Output 1

By using in this way, there is no need to add more RAM and FLASH usage.

The checkbox you are requesting will make the driver to start listening to another GA, consuming more flash and RAM. In the actual way, the resources usage is very low.

Please, try it. Thanks

@ascillato
Copy link
Contributor

I use it at home like this and the initial reading of the KNX network works fine with relays state, temperature, etc.

@darktheevil
Copy link

Hi , I have a similar problem as ss83. I also tried to implement the solution as described, but it ends in a loop on the KNX bus.

I need on the KNX group address 3/5/3 (Schalten = Switch -> 0 or 1) also state from Tasmota when a ReadREq form KNX Bus is comming. The solution which are described here #3165 (comment) also ends in a loop.

Setup

Output 1 -> 3/5/3
3/5/3 -> Output1

image

If I configure this, it comes to a loop on the bus.

image

image

thx and regards

@WoutervanZijl
Copy link

Hi , I have a similar problem as ss83. I also tried to implement the solution as described, but it ends in a loop on the KNX bus.

I need on the KNX group address 3/5/3 (Schalten = Switch -> 0 or 1) also state from Tasmota when a ReadREq form KNX Bus is comming. The solution which are described here #3165 (comment) also ends in a loop.

Setup

Output 1 -> 3/5/3 3/5/3 -> Output1

image

If I configure this, it comes to a loop on the bus.

image

image

thx and regards

Hello,

As always I do realy apreciate all the effort thats been put in this devolpment for tasmota knx.

I have exacly the same problem!
When i start home assistant everything works great but when I want a status update if i would push on the button itself on the tasmota device it needs to send a 1 or 0 to the GA but when I use the same GA for sending and recieving my relay also goes flickering realy fast. Tryed different routers but that's not the problem i believe. Not sure where to look now.

Cheers:)

@ascillato
Copy link
Contributor

Hi,

You can not use the same GA for input and output. That is a loop and won't work.

Tasmota answer the state when a read request arrives to the "group address to receive data".
Tasmota is not listening the "group address to send data".

If you make HA to read the GA "group address to receive data", Tasmota will work as expected.

You need to put different GA for "group address to receive data" and "group address to send data".

@WoutervanZijl
Copy link

Thanks for answering!

Could you maybe think with me how to make this situation possible?

Sonof relay with a switch button.

Home assistant.
Knx adress; 2/1/56
Knx state adress: 2/2/56

It is working indeed because I used both adresses group adress to recieve data when testing.

What is logic in my brain that the group state would indeed be at group adress to send. because then I can send the relay change to the same adress as 2/2/56.
It is no possible to do both now.

Or am i missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants