# MQTT Homeassistant: How to setup homeassistant device for ebusd

**URL:** <https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836>\
**Category:** Off-Topic\
**Tags:** homeassistant\
**Created:** [January 5, 2026, 8:33pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836 "2026-01-05T20:33:20Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 6:21pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/21 "2026-01-22T18:21:04Z")

</div>

I want to create a rule which informs me about the next maintainance.  
How can I find out why the script failed?  
Isn’t the argument to split() a regex? Doesn’t that mean that ‘.’ means “any character”?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 6:30pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/22 "2026-01-22T18:30:03Z")

</div>

Then changing the way it’s shown on the UIs through the state description is going to do nothing for you.

1. Use a date time type Channel
2. As I said above, chain your JSONPATH transformation to the JS transformation. The description in the UI tells you how to do that.
3. Trigger the rule using the DateTime Item.

Note, the rule will trigger at midnight on that date. If you want it at a different time, you’ll need to add that time in the JS transformation. Create a LocalDateTime instead of just a LocalDate and you’ll need to supply the hour and minute and second. [LocalDateTime | js-joda](https://js-joda.github.io/js-joda/class/packages/core/src/LocalDateTime.js~LocalDateTime.html)

> [@hermann59](#):
>
> How can I find out why the script failed?

You’ve added the transformation only to the way the Item is shown on the UI.

The Item has not been updated. It’s state is `NULL`. It will not receive a state until an MQTT message is received by OH.

When you tried to look at the Item in the UI, it invoked the transformation and that function doesn’t handle `NULL`. It doesn’t need to handle `NULL` because if you use it on the Channel it will never see `NULL`.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 7:05pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/23 "2026-01-22T19:05:33Z")

</div>

I replaced the channel with one of type DateTime and used the incoming value transformation

> JSONPATH:$.value.value∩JS(date\_dmy.js):%s

Now I get the following error:

> 2026-01-22 18:54:48.737 [WARN] [ab.binding.mqtt.generic.ChannelState] - Command ‘{  
> “value”: {“value”: “01.05.2018”}}’ from channel ‘mqtt:topic:mosquitto-localhost:Th\_Gastherme:Ch\_MaintenanceDate’ not supported by type ‘DateTimeValue’: {  
> “value”: {“value”: “01.05.2018”}} is not in a valid format.

What’s my fault?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 7:13pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/24 "2026-01-22T19:13:11Z")

</div>

> [@hermann59](#):
>
> JS(date\_dmy.js):%s

No `:%s`. That’s only used in Item labels and state description patterns. That’s not actually a part of the transformation at all.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 8:08pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/25 "2026-01-22T20:08:54Z")

</div>

I tried

> JS(date\_dmy.js) ∩ JSONPATH($.value.value)

and it seems that nothing happens. The value of the item is not set and there’s no log entry.  
If I change it to

> JSONPATH($.value.value) ∩ JS(date\_dmy.js)

I get a script error.

Any ideas what’s wrong?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 8:11pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/26 "2026-01-22T20:11:15Z")

</div>

> [@hermann59](#):
>
> and it seems that nothing happens. The value of the item is not set and there’s no log entry.  
> If I change it to

You have to put the JSONPATH first. Everything flows from left to right. The JSONPATH extracts the date and the JS changes the format into something that will work for OH.

> [@hermann59](#):
>
> I get a script error.

And the error is?

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 8:54pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/27 "2026-01-22T20:54:27Z")

</div>

Sorry, my post was wrong. Nothing happens when I use

> JSONPATH($.value.value) ∩ JS(date\_dmy.js)

No log entry in events.log or openhab.log, no item value change.

Is there something wrong with my item or the channel link?

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/d/4/d47f1d7e13f4c3d7136c668893d7a20d391806a5.png)

Is it possible to log a channel change?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 9:05pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/28 "2026-01-22T21:05:51Z")

</div>

> [@hermann59](#):
>
> JSONPATH($.value.value) ∩ JS(date\_dmy.js)

There should be no spaces around the ∩.

Also, there must be a _new_ message published to the MQTT topic before the Item will be updated and the transformation runs after every change to the Channel. No message, nothing to do and the Item remains `NULL`.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 9:13pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/29 "2026-01-22T21:13:50Z")

</div>

I force the ebusd to publish the current value using

> ebusctl read MaintenanceDate

And I check, if a new topic was posted using MQTT.fx  
So a new topic is always posted and should be received by the MQTT binding.  
Removing the spaces in the transformation did not change anything.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 9:17pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/30 "2026-01-22T21:17:39Z")

</div>

Logs?

If there is a message posted and the transformation doesn’t work there will be errors in the logs.

You are confirming a new message is being published using MQTT Explorer or some other tool?

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 9:29pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/31 "2026-01-22T21:29:47Z")

</div>

Yes. I use the MQTT explorer MQTT.fx. There I subscribe the topic “ebusd/430/MaintenanceDate”. And there I receive every topic ebusd published and I can see its content there.  
During the creation of the thing channel I copied the topic from MQTT.fx to avoid misspelling.  
Is there a way to ensure that the channel is triggered?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 9:52pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/32 "2026-01-22T21:52:31Z")

</div>

> [@hermann59](#):
>
> Is there a way to ensure that the channel is triggered?

Publish a message to the topic it subscribes to. That’s the only think that will cause the binding to do anything.

Note that MQTT Explorer shows _past_ messages. Double check the timestamp on the message to see when it was sent. That will tell you if ti was sent after saving the changes to the OH Thing.

If the message was not retained and the message was sent before you saved, nothing will happen.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 10:31pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/33 "2026-01-22T22:31:23Z")

</div>

This is what I do in a sequence:

- change the thing channel or item, save it
- afterwards trigger the publishing of the topic
- afterwards wait in the MQTT explorer for the new topic
- afterwards wait some seconds and check the log entries

This works for every channel except the one which uses “ebusd/430/MaintenanceDate”.  
It must either be

- a transformation problem or
- a problem with the link between item and channel or
- a problem in the item definition

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 10:38pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/34 "2026-01-22T22:38:31Z")

</div>

This is the channel definition:

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/6/2/623bed9f8fd2daac97b9026953aa9d131c1af595.jpeg)

and this is the item:

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/c/4/c473cf9069cf1495bc282a86053a4c4a3c3f9f62.png)

and here is the link:

 ![grafik](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/4/e/4e113a62ad9ccd8562a5f7932cb80a1bb9a3de12.png)

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 10:49pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/35 "2026-01-22T22:49:31Z")

</div>

> [@hermann59](#):
>
> a transformation problem

There will be errors in openhab.log if this is the case. Transformations do not fail with an error silently.

> [@hermann59](#):
>
> a problem with the link between item and channel or

There is pretty much nothing that can go wrong here unless you’ve applied a profile. All the link consists of is the name and the Channel ID. there isn’t something more that can break. But you can search for orphaned links in the karaf console. If there is a problem there, it will show up as orphaned.

> [@hermann59](#):
>
> a problem in the item definition

The Item wouldn’t show up at all if there is a problem there.

> [@hermann59](#):
>
> afterwards wait in the MQTT explorer for the new topic

Are you using this term “topic” deliberately or my mistake? The MQTT Thing subscribes to a topic for messages. It’s the messages that the get received and processed, not the topic.

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/d/f/df9ad6507357c2ee6f299eba1a980d6f0932e722.png)

If new topics are indeed being used, this isn’t going to work as configured and it’s going to get much more complicated depending on how these new topics are appearing.

> [@hermann59](#):
>
> This is the channel definition:

Don’t post screen shots. Click on the code tab and post the text you find there. Use code fences.

````
```
code goes here
```

````

Put the MQTT binding into debug or trace level logging. You’ll see _everything_ that the MQTT binding is doing when/if these messages arrive.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 10:52pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/36 "2026-01-22T22:52:53Z")

</div>

> [@rlkoshak](#):
>
> Put the MQTT binding into debug or trace level logging. You’ll see _everything_ that the MQTT binding is doing when/if these messages arrive.

How do I do that? I use the MQTT binding very frequently. How do I avoid thousands of log messages?

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [January 22, 2026, 10:59pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/37 "2026-01-22T22:59:41Z")

</div>

> [@hermann59](#):
>
> How do I do that? I use the MQTT binding very frequently. How do I avoid thousands of log messages?

Maybe disable all the other Things and Channels except this one, put the binding into debug or trace logging, and then run the test. Restore everything when done.

Or just let it log everything and search through the logs related to this one Channel.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 11:03pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/38 "2026-01-22T23:03:10Z")

</div>

Thanks to the good documentation I could set the debug level on the binding.  
Now I get the following log:

> 2026-01-22 23:00:13.011 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation ‘{  
> “value”: {“value”: “01.05.2018”}}’ returned null on ‘org.openhab.core.thing.binding.generic.ChannelTransformation@1179d1db’, discarding message

ok, it’s the transformation. but why?

I changed the log level to TRACE but I didn’t get any additional info.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 22, 2026, 11:38pm UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/39 "2026-01-22T23:38:22Z")

</div>

There is something wrong with the transformation to a DateTime.  
I changed the Javascript to

> (function(i){  
> console.info(“date\_dmy input”, i)  
> const words = i.split(‘\.’); // Datum im Format dd.mm.yyyy  
> const result = time.LocalDate.of(parseInt(words[2]), parseInt(words[1]), parseInt(words[0])).toString();  
> console.info(“date\_dmy result”, result)  
> return result  
> })(input)

and I get the following logs:

> 2026-01-22 23:33:45.339 [INFO] [scripting.transformation.date\_dmy.js] - date\_dmy input 01.05.2018  
> 2026-01-22 23:33:45.348 [DEBUG] [ab.binding.mqtt.generic.ChannelState] - Transformation ‘{  
> “value”: {“value”: “01.05.2018”}}’ returned null on ‘org.openhab.core.thing.binding.generic.ChannelTransformation@1179d1db’, discarding message

The first log line is executed but not the second.

---

<div class="post-metadata">

**Author:** ![hermann59](https://community.openhab.org/letter_avatar_proxy/v4/letter/h/51bf81/32.png) [@hermann59](https://community.openhab.org/u/hermann59)\
**Post date:** [January 23, 2026, 12:04am UTC](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836/40 "2026-01-23T00:04:00Z")

</div>

With this settings it works:

1. date\_dmy.js:

> (function(i){  
> [//console.info](https://console.info)(“date\_dmy input”, i)  
> const words = i.split(‘.’); // Datum im Format dd.mm.yyyy  
> [//console.info](https://console.info)(“date\_dmy words[0]”, words[0])  
> [//console.info](https://console.info)(“date\_dmy words[1]”, words[1])  
> [//console.info](https://console.info)(“date\_dmy words[2]”, words[2])  
> const result = time.LocalDateTime.of(parseInt(words[2]), parseInt(words[1]), parseInt(words[0]), 0, 0).toString();  
> [//console.info](https://console.info)(“date\_dmy result”, result)  
> return result  
> })(input)

1. pattern in the state description of the item:

> %1$td.%1$tm.%1$tY

Result is an Item of Type DateTime, which e. g. is displayed as “01.05.2018”.

@rlkoshak: Thanks a lot for your great support

[Previous page](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836.md?page=1)

[Next page](https://community.openhab.org/t/mqtt-homeassistant-how-to-setup-homeassistant-device-for-ebusd/167836.md?page=3)
