Code Monkey home page Code Monkey logo

daikin-mqtt's People

Contributors

dependabot[bot] avatar magcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

daikin-mqtt's Issues

Some questions

Hello

I have several questions:

  1. regarding MQTT - what to do if the broker requires a username and password?
  2. regarding inclusion only when there is a clear power/set 'on' and then not when changing only mode/set 'cool to dry'?
  3. are you planning to create a docker container?

Thanks for your code.

Retanied messages are needed? Side effect.

I've seen that the messages are published as "retained".
IMHO this is not necessary because the "subscriber" will receive:

  • The LWT (or the last state) message in order to know immediately know the state of the device.
  • Updated data at the defined interval
    Furher the "retained" messages could be very old creating noise in the subscriber.

Side effect
Every test/device remain in the broker db and is delivered at every connection at every subscriber; in this example i've done a test using ac-room1 deviceid and now every subscribers (different mqtt clientid) receive a full set of data at every connection:
image
image

ERROR: Unknown wireless control state: dmnd_run = 0

Hi
i've immediately used your .jar (thanks a lot for it) and i got the error:

java -jar daikin-mqtt-1.0.0-jar-with-dependencies.jar

11:41:55.182 [main] INFO  org.magcode.daikin.DaikinMqttClient - Loading properties from C:\Users\A130754\Dropbox\Sviluppo\_Tests\daikinmqtt/daikin.properties
11:41:55.549 [main] INFO  org.magcode.daikin.DaikinMqttClient - Connected to MQTT broker.
11:41:55.561 [main] INFO  org.magcode.daikin.DaikinMqttClient - Subscribed to daikintest/ac-room1/aircon/+/set
Exception in thread "main" java.lang.IllegalArgumentException: Unknown wireless control state: dmnd_run = 0
        at net.jonathangiles.daikin.wireless.WirelessDaikin.readDaikinState(WirelessDaikin.java:123)
        at net.jonathangiles.daikin.DaikinBase.<init>(DaikinBase.java:45)
        at net.jonathangiles.daikin.wireless.WirelessDaikin.<init>(WirelessDaikin.java:19)
        at net.jonathangiles.daikin.DaikinFactory.createWirelessDaikin(DaikinFactory.java:22)
        at org.magcode.daikin.DaikinMqttClient.main(DaikinMqttClient.java:61)

Maybe it can be a problem related to the wireless adapter or firmware revision.

The response the the services:

aircon/get_control_info
ret=OK,pow=0,mode=3,adv=,stemp=24.0,shum=0,dt1=25.0,dt2=M,dt3=24.0,dt4=25.0,dt5=25.0,dt7=25.0,dh1=AUTO,dh2=50,dh3=0,dh4=0,dh5=0,dh7=AUTO,dhh=50,b_mode=3,b_stemp=24.0,b_shum=0,alert=255,f_rate=5,f_dir=0,b_f_rate=5,b_f_dir=0,dfr1=5,dfr2=5,dfr3=5,dfr4=5,dfr5=5,dfr6=5,dfr7=5,dfrh=5,dfd1=0,dfd2=0,dfd3=0,dfd4=0,dfd5=0,dfd6=0,dfd7=0,dfdh=0,dmnd_run=0,en_demand=0

aircon/get_model_info
ret=OK,model=0000,type=N,pv=3.20,cpv=3,cpv_minor=20,mid=NA,humd=0,s_humd=0,acled=0,land=0,elec=1,temp=1,temp_rng=0,m_dtct=1,ac_dst=--,disp_dry=0,dmnd=1,en_scdltmr=1,en_frate=1,en_fdir=1,s_fdir=3,en_rtemp_a=0,en_spmode=7,en_ipw_sep=1,en_mompow=0,hmlmt_l=10.0

If you like to go deeper and maybe support this device I can provide you the complete set of calls and support for testing.

Let me know and thanks again.
f

Device unreachable and $state value

Device unreachable

In the log I find:

2020-06-01 12:40:57.837 [pool-2-thread-1] DEBUG org.magcode.daikin.mqtt.MqttNodePublisher -
					Daikin notte is unreachable
2020-06-01 12:43:58.855 [pool-2-thread-1] DEBUG org.magcode.daikin.mqtt.MqttNodePublisher -
					Daikin giorno is unreachable
2020-06-01 13:18:58.245 [pool-2-thread-1] DEBUG org.magcode.daikin.mqtt.MqttNodePublisher -
					Daikin giorno is unreachable
2020-06-01 14:18:57.330 [pool-2-thread-1] DEBUG org.magcode.daikin.mqtt.MqttNodePublisher -
					Daikin notte is unreachable
2020-06-01 16:42:27.839 [pool-2-thread-1] DEBUG org.magcode.daikin.mqtt.MqttNodePublisher -
					Daikin notte is unreachable
2020-06-01 17:21:57.662 [pool-2-thread-1] DEBUG org.magcode.daikin.mqtt.MqttNodePublisher -
					Daikin giorno is unreachable

I don't know if, by design, this should affect the $state; In my test there has been not any change.

LWT message

The homie ask for a LWT message:
MQTT only allows one last will message per connection. Homie requires the last will (LWT) to set the homie / device ID / $state attribute to the value lost

It seems that this is not implemented because in my subscription i can see always "ready" state even if the java gateway is disconnected from mqtt.

MQTT Reconnect

MQTT Reconnect

After a network error tha gatway falls in "client disconnesso" state and does not reconnect (following a short sample from the log):

19:38:55.658 [pool-2-thread-1] ERROR org.magcode.daikin.mqtt.MqttNodePublisher - MQTT error
org.eclipse.paho.client.mqttv3.MqttException: Client non connesso
        at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait(ClientComms.java:203) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.MqttAsyncClient.publish(MqttAsyncClient.java:1251) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.MqttClient.publish(MqttClient.java:570) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.magcode.daikin.mqtt.MqttNodePublisher.run(MqttNodePublisher.java:54) [daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
19:39:25.454 [pool-2-thread-1] ERROR org.magcode.daikin.mqtt.MqttNodePublisher - MQTT error
org.eclipse.paho.client.mqttv3.MqttException: Client non connesso
        at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait(ClientComms.java:203) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.MqttAsyncClient.publish(MqttAsyncClient.java:1251) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.MqttClient.publish(MqttClient.java:570) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.magcode.daikin.mqtt.MqttNodePublisher.run(MqttNodePublisher.java:54) [daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
19:39:26.283 [pool-2-thread-1] ERROR org.magcode.daikin.mqtt.MqttNodePublisher - MQTT error
org.eclipse.paho.client.mqttv3.MqttException: Client non connesso
        at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.internal.ClientComms.sendNoWait(ClientComms.java:203) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.MqttAsyncClient.publish(MqttAsyncClient.java:1251) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.eclipse.paho.client.mqttv3.MqttClient.publish(MqttClient.java:570) ~[daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at org.magcode.daikin.mqtt.MqttNodePublisher.run(MqttNodePublisher.java:54) [daikin-mqtt-1.0.1-jar-with-dependencies.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]

MQTT Topic for sending commands

In the readme.md are documented the topics:
image

In my test I can send commands to topics without the $ sign (as reported in the log):
image

Commands not executed

I've sent more commands as you can see in the log:

10:05:20.492 [MQTT Call: client-for-daikin-on-IT000000682235] INFO  org.magcode.daikin.mqtt.MqttSubscriber - Send targettemp=20.0 to giorno
10:06:06.144 [MQTT Call: client-for-daikin-on-IT000000682235] INFO  org.magcode.daikin.mqtt.MqttSubscriber - Send targettemp=20.0 to giorno
10:06:44.129 [MQTT Call: client-for-daikin-on-IT000000682235] INFO  org.magcode.daikin.mqtt.MqttSubscriber - Sending power=on to giorno
10:06:44.535 [MQTT Call: client-for-daikin-on-IT000000682235] INFO  org.magcode.daikin.mqtt.MqttSubscriber - Sending mode=Cool to giorno
10:10:38.384 [MQTT Call: client-for-daikin-on-IT000000682235] INFO  org.magcode.daikin.mqtt.MqttSubscriber - Send targettemp=20.0 to giorno
10:11:21.565 [MQTT Call: client-for-daikin-on-IT000000682235] INFO  org.magcode.daikin.mqtt.MqttSubscriber - Sending mode=Auto to giorno
10:14:09.182 [MQTT Call: client-for-daikin-on-IT000000682235] INFO  org.magcode.daikin.mqtt.MqttSubscriber - Sending mode=Dry to giorno

but none has been received/ececuted by the split.
I'm sorry but there no more info in the log let me know if you need some kind of analysis.

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.