Taking a decimal out of a result?

In the below flow, when I inject, I get a readout of what an input_number is currently set to. In this example its 60.0. Not shown here because it doesnt matter, but it gets passed along to an alexa node for her to speak it, but she says “sixty point zero”

I just want her to say “sixty”

What can I put between the current state node and the debug node to get 60.0 to change to just 60? And ‘State Type’ must remain string. If I change it to number, Alexa can speak it

[{"id":"6dc06544284bac5e","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"cef8c3c3d769eeee","type":"api-current-state","z":"6dc06544284bac5e","name":"Turn-on temp value","server":"ab3e2c53.e3491","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.garage_heater_turn_on_temp","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1395,"y":165,"wires":[["ede636f478ba29d1"]]},{"id":"2085a4846c5a572c","type":"inject","z":"6dc06544284bac5e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1200,"y":165,"wires":[["cef8c3c3d769eeee"]]},{"id":"ede636f478ba29d1","type":"debug","z":"6dc06544284bac5e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1580,"y":165,"wires":[]},{"id":"ab3e2c53.e3491","type":"server","name":"AvilaSmartHome","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

In the output properties in the current state node

$number($entity().state)

image

or you could set the State Type of the current state node to Number

Alexa can read numbers for some reason. When I set it her to speak msg.payload, she will only speak when state type is string. If I change state type to number, I get following:


image

$string($number($entity().state))

1 Like

Your’re the man! once again