Send Datestring on switch

Hello, is it possible to send a Time/Date String on a Switch action?

something like this:

Switch LED_Status “HCI” {mqtt=">[mosquitto:LED/STATUS:command:*:DATETIME]"}

Everything is possible (they say…) :slight_smile:
Maybe you should explain what you want to achieve with a little more detail…

You can use a switch to trigger a rule. In a rule, you can create a string that includes some date/time. In the same rule, you can send the string via an MQTT Action.

i have found a way =)

i want only see when the switch was last used

rule "last_switch_action LED"
	when 
		  Item LED_Switch_State changed
	then
		postUpdate(LED_DATE, new DateTimeType() )
end	

items:

String LED_Switch_State    		"LED [MAP(light.map):%s]" {mqtt="<[mosquitto:LED:state:default]"}
DateTime LED_DATE				"Datum: [%1$tA, %1$td.%1$tm.%1$tY %1$tT]"